Skip to content

Commit

Permalink
options for strict tests; few enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelru committed Jan 24, 2024
1 parent 6e1a17d commit a6b690f
Show file tree
Hide file tree
Showing 50 changed files with 434 additions and 456 deletions.
32 changes: 32 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,35 @@ linters: linters_with_defaults(
object_usage_linter = NULL,
indentation_linter = NULL
)
exclusions: list(
"vignettes/teal-modules-general.Rmd" = list(
object_name_linter = Inf
),
"vignettes/using-association-plot.Rmd" = list(
object_name_linter = Inf
),
"vignettes/using-bivariate-plot.Rmd" = list(
object_name_linter = Inf
),
"vignettes/using-cross-table.Rmd" = list(
object_name_linter = Inf
),
"vignettes/using-data-table.Rmd" = list(
object_name_linter = Inf
),
"vignettes/using-outliers-module.Rmd" = list(
object_name_linter = Inf
),
"vignettes/using-regression-plots.Rmd" = list(
object_name_linter = Inf
),
"vignettes/using-response-plot.Rmd" = list(
object_name_linter = Inf
),
"vignettes/using-scatterplot-matrix.Rmd" = list(
object_name_linter = Inf
),
"vignettes/using-scatterplot.Rmd" = list(
object_name_linter = Inf
)
)
11 changes: 6 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,27 @@ Suggests:
rtables (>= 0.5.1),
sparkline,
teal.data (>= 0.3.0.9018),
testthat (>= 3.0.4)
testthat (>= 3.0.4),
withr (>= 2.0.0)
VignetteBuilder:
knitr
Config/Needs/verdepcheck: haleyjeppson/ggmosaic, tidyverse/ggplot2,
rstudio/shiny, shinyTree/shinyTree, insightsengineering/teal,
rstudio/shiny, shinyTree/shinyTree, insightsengineering/teal, insightsengineering/teal.transform,
mllg/checkmate, tidyverse/dplyr, rstudio/DT, tidyverse/forcats,
daroczig/logger, tidyverse/magrittr, r-lib/scales, daattali/shinyjs,
rstudio/shinyvalidate, dreamRs/shinyWidgets, tidyverse/stringr,
insightsengineering/teal.code, insightsengineering/teal.logger,
insightsengineering/teal.reporter, insightsengineering/teal.transform,
insightsengineering/teal.reporter,
insightsengineering/teal.widgets, insightsengineering/tern,
tidyverse/tibble, tidyverse/tidyr, r-lib/tidyselect, tidymodels/broom,
daattali/colourpicker, daattali/ggExtra, aphalo/ggpmisc, aphalo/ggpp,
baddstats/goftest, gridExtra, ramnathv/htmlwidgets, jeroen/jsonlite,
yihui/knitr, deepayan/lattice, MASS, insightsengineering/nestcolor,
r-lib/rlang, insightsengineering/rtables, sparkline,
insightsengineering/teal.data, r-lib/testthat
insightsengineering/teal.data, r-lib/testthat, r-lib/withr
Config/Needs/website: insightsengineering/nesttemplate
Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.0
4 changes: 1 addition & 3 deletions R/teal.modules.general.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
#' @importFrom magrittr %>%
#'
#'
#' @docType package
#' @name teal.modules.general
#' @keywords internal
NULL
"_PACKAGE"

# nolint start
# Note ggmosaic (version <= 0.3.3) needs to be in DEPENDS as the following does not work if it is imported
Expand Down
16 changes: 8 additions & 8 deletions R/tm_a_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@
#' @export
#'
#' @examples
#'
#' # ADSL example
#'
#' data <- teal_data()
#' data <- within(data, {
#' library(nestcolor)
#' ADSL <- teal.modules.general::rADSL
#' ADSL <- rADSL
#' })
#' datanames <- c("ADSL")
#' datanames(data) <- datanames
#' join_keys(data) <- default_cdisc_join_keys[datanames]
#' app <- teal::init(
#'
#' app <- init(
#' data = data,
#' modules = teal::modules(
#' teal.modules.general::tm_a_pca(
#' modules = modules(
#' tm_a_pca(
#' "PCA",
#' dat = teal.transform::data_extract_spec(
#' dat = data_extract_spec(
#' dataname = "ADSL",
#' select = teal.transform::select_spec(
#' choices = teal.transform::variable_choices(
#' select = select_spec(
#' choices = variable_choices(
#' data = data[["ADSL"]], c("BMRKR1", "AGE", "EOSDY")
#' ),
#' selected = c("BMRKR1", "AGE"),
Expand Down
18 changes: 9 additions & 9 deletions R/tm_a_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,32 @@
#' data <- teal_data()
#' data <- within(data, {
#' library(nestcolor)
#' ADSL <- teal.modules.general::rADSL
#' ADSL <- rADSL
#' })
#' datanames <- c("ADSL")
#' datanames(data) <- datanames
#' join_keys(data) <- default_cdisc_join_keys[datanames]
#'
#' app <- teal::init(
#' app <- init(
#' data = data,
#' modules = teal::modules(
#' teal.modules.general::tm_a_regression(
#' modules = modules(
#' tm_a_regression(
#' label = "Regression",
#' response = teal.transform::data_extract_spec(
#' response = data_extract_spec(
#' dataname = "ADSL",
#' select = teal.transform::select_spec(
#' select = select_spec(
#' label = "Select variable:",
#' choices = "BMRKR1",
#' selected = "BMRKR1",
#' multiple = FALSE,
#' fixed = TRUE
#' )
#' ),
#' regressor = teal.transform::data_extract_spec(
#' regressor = data_extract_spec(
#' dataname = "ADSL",
#' select = teal.transform::select_spec(
#' select = select_spec(
#' label = "Select variables:",
#' choices = teal.transform::variable_choices(data[["ADSL"]], c("AGE", "SEX", "RACE")),
#' choices = variable_choices(data[["ADSL"]], c("AGE", "SEX", "RACE")),
#' selected = "AGE",
#' multiple = TRUE,
#' fixed = FALSE
Expand Down
9 changes: 4 additions & 5 deletions R/tm_data_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,19 @@
#' Note though that sorting of numeric columns with `NA`/`Inf` will be lexicographic not numerical.
#' @export
#' @examples
#'
#' data <- teal_data()
#' data <- within(data, {
#' library(nestcolor)
#' ADSL <- teal.modules.general::rADSL
#' ADSL <- rADSL
#' })
#' datanames <- c("ADSL")
#' datanames(data) <- datanames
#' join_keys(data) <- default_cdisc_join_keys[datanames]
#'
#' app <- teal::init(
#' app <- init(
#' data = data,
#' modules = teal::modules(
#' teal.modules.general::tm_data_table(
#' modules = modules(
#' tm_data_table(
#' variables_selected = list(ADSL = c("STUDYID", "USUBJID", "SUBJID", "SITEID", "AGE", "SEX")),
#' dt_args = list(caption = "ADSL Table Caption")
#' )
Expand Down
6 changes: 3 additions & 3 deletions R/tm_file_viewer.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#' })
#' datanames(data) <- c("data")
#'
#' app <- teal::init(
#' app <- init(
#' data = data,
#' modules = teal::modules(
#' teal.modules.general::tm_file_viewer(
#' modules = modules(
#' tm_file_viewer(
#' input_path = list(
#' folder = system.file("sample_files", package = "teal.modules.general"),
#' png = system.file("sample_files/sample_file.png", package = "teal.modules.general"),
Expand Down
9 changes: 4 additions & 5 deletions R/tm_front_page.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
#' @return A `teal` module to be used in `teal` applications
#' @export
#' @examples
#'
#' data <- teal_data()
#' data <- within(data, {
#' library(nestcolor)
#' ADSL <- teal.modules.general::rADSL
#' ADSL <- rADSL
#' attr(ADSL, "metadata") <- list("Author" = "NEST team", "data_source" = "synthetic data")
#' })
#' datanames <- c("ADSL")
Expand All @@ -37,10 +36,10 @@
#' "Table 3" = table_3
#' )
#'
#' app <- teal::init(
#' app <- init(
#' data = data,
#' modules = teal::modules(
#' teal.modules.general::tm_front_page(
#' modules = modules(
#' tm_front_page(
#' header_text = c(
#' "Important information" = "It can go here.",
#' "Other information" = "Can go here."
Expand Down
20 changes: 10 additions & 10 deletions R/tm_g_association.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,33 @@
#' data <- teal_data()
#' data <- within(data, {
#' library(nestcolor)
#' ADSL <- teal.modules.general::rADSL
#' ADSL <- rADSL
#' })
#' datanames <- c("ADSL")
#' datanames(data) <- datanames
#' join_keys(data) <- default_cdisc_join_keys[datanames]
#'
#' app <- teal::init(
#' app <- init(
#' data = data,
#' modules = teal::modules(
#' teal.modules.general::tm_g_association(
#' ref = teal.transform::data_extract_spec(
#' modules = modules(
#' tm_g_association(
#' ref = data_extract_spec(
#' dataname = "ADSL",
#' select = teal.transform::select_spec(
#' select = select_spec(
#' label = "Select variable:",
#' choices = teal.transform::variable_choices(
#' choices = variable_choices(
#' data[["ADSL"]],
#' c("SEX", "RACE", "COUNTRY", "ARM", "STRATA1", "STRATA2", "ITTFL", "BMRKR2")
#' ),
#' selected = "RACE",
#' fixed = FALSE
#' )
#' ),
#' vars = teal.transform::data_extract_spec(
#' vars = data_extract_spec(
#' dataname = "ADSL",
#' select = teal.transform::select_spec(
#' select = select_spec(
#' label = "Select variables:",
#' choices = teal.transform::variable_choices(
#' choices = variable_choices(
#' data[["ADSL"]],
#' c("SEX", "RACE", "COUNTRY", "ARM", "STRATA1", "STRATA2", "ITTFL", "BMRKR2")
#' ),
Expand Down
34 changes: 16 additions & 18 deletions R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,49 +48,49 @@
#' data <- teal_data()
#' data <- within(data, {
#' library(nestcolor)
#' ADSL <- teal.modules.general::rADSL
#' ADSL <- rADSL
#' })
#' datanames <- c("ADSL")
#' datanames(data) <- datanames
#' join_keys(data) <- default_cdisc_join_keys[datanames]
#'
#' app <- teal::init(
#' app <- init(
#' data = data,
#' modules = teal::modules(
#' teal.modules.general::tm_g_bivariate(
#' x = teal.transform::data_extract_spec(
#' modules = modules(
#' tm_g_bivariate(
#' x = data_extract_spec(
#' dataname = "ADSL",
#' select = teal.transform::select_spec(
#' select = select_spec(
#' label = "Select variable:",
#' choices = teal.transform::variable_choices(data[["ADSL"]]),
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "AGE",
#' fixed = FALSE
#' )
#' ),
#' y = teal.transform::data_extract_spec(
#' y = data_extract_spec(
#' dataname = "ADSL",
#' select = teal.transform::select_spec(
#' select = select_spec(
#' label = "Select variable:",
#' choices = teal.transform::variable_choices(data[["ADSL"]]),
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "SEX",
#' multiple = FALSE,
#' fixed = FALSE
#' )
#' ),
#' row_facet = teal.transform::data_extract_spec(
#' row_facet = data_extract_spec(
#' dataname = "ADSL",
#' select = teal.transform::select_spec(
#' select = select_spec(
#' label = "Select variable:",
#' choices = teal.transform::variable_choices(data[["ADSL"]]),
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "ARM",
#' fixed = FALSE
#' )
#' ),
#' col_facet = teal.transform::data_extract_spec(
#' col_facet = data_extract_spec(
#' dataname = "ADSL",
#' select = teal.transform::select_spec(
#' select = select_spec(
#' label = "Select variable:",
#' choices = teal.transform::variable_choices(data[["ADSL"]]),
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "COUNTRY",
#' fixed = FALSE
#' )
Expand Down Expand Up @@ -652,7 +652,6 @@ srv_g_bivariate <- function(id,
#' @noRd
#'
#' @examples
#'
#' bivariate_plot_call("ANL", "BAGE", "RACE", "numeric", "factor")
#' bivariate_plot_call("ANL", "BAGE", character(0), "numeric", "NULL")
bivariate_plot_call <- function(data_name,
Expand Down Expand Up @@ -922,7 +921,6 @@ bivariate_ggplot_call <- function(x_class = c("NULL", "numeric", "integer", "fac
#' @noRd
#'
#' @examples
#'
#' facet_ggplot_call(LETTERS[1:3])
#' facet_ggplot_call(NULL, LETTERS[23:26])
#' facet_ggplot_call(LETTERS[1:3], LETTERS[23:26])
Expand Down
Loading

0 comments on commit a6b690f

Please sign in to comment.