Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ repos:
- id: roxygenize
name: Regenerate package documentation
additional_dependencies:
- ggmosaic
- ggplot2
- shiny
- checkmate
Expand Down
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ URL: https://insightsengineering.github.io/teal.modules.general/,
BugReports:
https://github.com/insightsengineering/teal.modules.general/issues
Depends:
ggmosaic (>= 0.3.0),
ggplot2 (>= 3.4.0),
R (>= 4.1),
shiny (>= 1.8.1),
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export(tm_missing_data)
export(tm_outliers)
export(tm_t_crosstable)
export(tm_variable_browser)
import(ggmosaic)
import(ggplot2)
import(shiny)
import(teal)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# teal.modules.general 0.5.1

- Removed ggmosaic package dependency to avoid being archived on CRAN (#932).

# teal.modules.general 0.5.0

### Breaking changes
Expand Down
7 changes: 0 additions & 7 deletions R/teal.modules.general.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#' (not necessarily for clinical trials data).
#'
#' @import ggplot2
#' @import ggmosaic
#' @import shiny
#' @import teal
#' @import teal.transform
Expand All @@ -15,11 +14,5 @@
#' @keywords internal
"_PACKAGE"

# nolint start
# Note ggmosaic (version <= 0.3.3) needs to be in DEPENDS as the following does not work if it is imported
# df <- data.frame(x = c("A", "B", "C", "A"), y = c("Z", "Z", "W", "W"))
# ggplot(df) + ggmosaic::geom_mosaic(aes(x = ggmosaic::product(x), fill = y))
# nolint end

# Needed to avoid R CMD note on no visible binding
utils::globalVariables("count")
2 changes: 1 addition & 1 deletion R/tm_g_association.R
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ srv_tm_g_association <- function(id,
)

qenv <- reactive(
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr");library("tern");library("ggmosaic")') # nolint quotes
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr");library("tern")') # nolint quotes
)
anl_merged_q <- reactive({
req(anl_merged_input())
Expand Down
8 changes: 1 addition & 7 deletions R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -968,13 +968,7 @@ bivariate_ggplot_call <- function(x_class,
)
# Factor and character plots
} else if (x_class == "factor" && y_class == "factor") {
plot_call <- reduce_plot_call(
plot_call,
substitute(
ggmosaic::geom_mosaic(aes(x = ggmosaic::product(xval), fill = yval), na.rm = TRUE),
env = list(xval = x, yval = y)
)
)
stop("Categorical variables 'x' and 'y' are currently not supported.")
} else {
stop("x y type combination not allowed")
}
Expand Down
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ UI
datatables
facetting
funder
ggmosaic
ggplot
pre
qq
Expand Down
31 changes: 16 additions & 15 deletions tests/testthat/test_bivariate_ggplot_call.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,34 @@ testthat::test_that("bivariate_ggplot_call with numerics", {
})

testthat::test_that("bivariate_ggplot_call with factor, char, logical", {
testthat::expect_match(
error_message <- "Categorical variables 'x' and 'y' are currently not supported."
testthat::expect_error(
bivariate_ggplot_call("factor", "factor") %>% deparse(width.cutoff = 300),
"geom_mosaic"
error_message
)
testthat::expect_match(
testthat::expect_error(
bivariate_ggplot_call("logical", "factor") %>% deparse(width.cutoff = 300),
"geom_mosaic"
)
testthat::expect_match(
error_message
)
testthat::expect_error(
bivariate_ggplot_call("character", "factor") %>% deparse(width.cutoff = 300),
"geom_mosaic"
error_message
)
testthat::expect_match(
testthat::expect_error(
bivariate_ggplot_call("logical", "character") %>% deparse(width.cutoff = 300),
"geom_mosaic"
error_message
)
testthat::expect_match(
testthat::expect_error(
bivariate_ggplot_call("character", "logical") %>% deparse(width.cutoff = 300),
"geom_mosaic"
error_message
)
testthat::expect_match(
testthat::expect_error(
bivariate_ggplot_call("logical", "logical") %>% deparse(width.cutoff = 300),
"geom_mosaic"
error_message
)
testthat::expect_match(
testthat::expect_error(
bivariate_ggplot_call("character", "character") %>% deparse(width.cutoff = 300),
"geom\\_mosaic"
error_message
)
})

Expand Down