Skip to content

Commit db85877

Browse files
committed
Remove ggmosaic
1 parent 3ca0aca commit db85877

File tree

9 files changed

+15
-25
lines changed

9 files changed

+15
-25
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ repos:
1515
- id: roxygenize
1616
name: Regenerate package documentation
1717
additional_dependencies:
18-
- ggmosaic
1918
- ggplot2
2019
- shiny
2120
- insightsengineering/teal

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ URL: https://insightsengineering.github.io/teal.modules.general/,
2323
BugReports:
2424
https://github.com/insightsengineering/teal.modules.general/issues
2525
Depends:
26-
ggmosaic (>= 0.3.0),
2726
ggplot2 (>= 3.4.0),
2827
R (>= 4.1),
2928
shiny (>= 1.8.1),

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export(tm_missing_data)
2525
export(tm_outliers)
2626
export(tm_t_crosstable)
2727
export(tm_variable_browser)
28-
import(ggmosaic)
2928
import(ggplot2)
3029
import(shiny)
3130
import(teal)

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
- Modules now return a `teal_report` object that contains the data, code and reporter. All the reporter buttons were removed from the modules' UI.
66

7+
# teal.modules.general 0.5.1
8+
9+
- Removed ggmosaic package dependency to avoid being archived on CRAN (#932).
10+
711
# teal.modules.general 0.5.0
812

913
### Breaking changes

R/teal.modules.general.R

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#' (not necessarily for clinical trials data).
55
#'
66
#' @import ggplot2
7-
#' @import ggmosaic
87
#' @import shiny
98
#' @import teal
109
#' @import teal.transform
@@ -15,11 +14,5 @@
1514
#' @keywords internal
1615
"_PACKAGE"
1716

18-
# nolint start
19-
# Note ggmosaic (version <= 0.3.3) needs to be in DEPENDS as the following does not work if it is imported
20-
# df <- data.frame(x = c("A", "B", "C", "A"), y = c("Z", "Z", "W", "W"))
21-
# ggplot(df) + ggmosaic::geom_mosaic(aes(x = ggmosaic::product(x), fill = y))
22-
# nolint end
23-
2417
# Needed to avoid R CMD note on no visible binding
2518
utils::globalVariables("count")

R/tm_g_association.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ srv_tm_g_association <- function(id,
345345
teal.reporter::teal_card(obj),
346346
teal.reporter::teal_card("## Module's output(s)")
347347
)
348-
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr");library("ggmosaic")') # nolint: quotes
348+
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr")') # nolint: quotes
349349
})
350350
anl_merged_q <- reactive({
351351
req(anl_merged_input())

R/tm_g_bivariate.R

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -927,13 +927,7 @@ bivariate_ggplot_call <- function(x_class,
927927
)
928928
# Factor and character plots
929929
} else if (x_class == "factor" && y_class == "factor") {
930-
plot_call <- reduce_plot_call(
931-
plot_call,
932-
substitute(
933-
ggmosaic::geom_mosaic(aes(x = ggmosaic::product(xval), fill = yval), na.rm = TRUE),
934-
env = list(xval = x, yval = y)
935-
)
936-
)
930+
stop("Categorical variables 'x' and 'y' are currently not supported.")
937931
} else {
938932
stop("x y type combination not allowed")
939933
}

R/utils.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ set_chunk_dims <- function(pws, q_r, inner_classes = NULL) {
444444
checkmate::assert_character(inner_classes, null.ok = TRUE)
445445

446446
reactive({
447+
# browser()
447448
pws_dim <- stats::setNames(as.list(req(pws$dim())), c("width", "height"))
448449
if (identical(pws_dim$width, "auto")) { # ignore non-numeric values (such as "auto")
449450
pws_dim$width <- NULL

tests/testthat/test_bivariate_ggplot_call.R

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,34 @@ testthat::test_that("bivariate_ggplot_call with numerics", {
1919
})
2020

2121
testthat::test_that("bivariate_ggplot_call with factor, char, logical", {
22+
error_message <- "Categorical variables 'x' and 'y' are currently not supported."
2223
testthat::expect_match(
2324
bivariate_ggplot_call("factor", "factor") %>% deparse(width.cutoff = 300),
24-
"geom_mosaic"
25+
error_message
2526
)
2627
testthat::expect_match(
2728
bivariate_ggplot_call("logical", "factor") %>% deparse(width.cutoff = 300),
28-
"geom_mosaic"
29+
error_message
2930
)
3031
testthat::expect_match(
3132
bivariate_ggplot_call("character", "factor") %>% deparse(width.cutoff = 300),
32-
"geom_mosaic"
33+
error_message
3334
)
3435
testthat::expect_match(
3536
bivariate_ggplot_call("logical", "character") %>% deparse(width.cutoff = 300),
36-
"geom_mosaic"
37+
error_message
3738
)
3839
testthat::expect_match(
3940
bivariate_ggplot_call("character", "logical") %>% deparse(width.cutoff = 300),
40-
"geom_mosaic"
41+
error_message
4142
)
4243
testthat::expect_match(
4344
bivariate_ggplot_call("logical", "logical") %>% deparse(width.cutoff = 300),
44-
"geom_mosaic"
45+
error_message
4546
)
4647
testthat::expect_match(
4748
bivariate_ggplot_call("character", "character") %>% deparse(width.cutoff = 300),
48-
"geom\\_mosaic"
49+
error_message
4950
)
5051
})
5152

0 commit comments

Comments
 (0)