diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index 94e597bd9..70a1d9845 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -40,7 +40,7 @@ #' dat = teal.transform::data_extract_spec( #' dataname = "ADSL", #' select = teal.transform::select_spec( -#' choices = teal.transform::variable_choices(data = data@env$ADSL, c("BMRKR1", "AGE", "EOSDY")), +#' choices = teal.transform::variable_choices(data = data[["ADSL"]], c("BMRKR1", "AGE", "EOSDY")), #' selected = c("BMRKR1", "AGE"), #' multiple = TRUE #' ), diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index 84282d744..2a6418716 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -62,7 +62,7 @@ #' dataname = "ADSL", #' select = teal.transform::select_spec( #' label = "Select variables:", -#' choices = teal.transform::variable_choices(data@env$ADSL, c("AGE", "SEX", "RACE")), +#' choices = teal.transform::variable_choices(data[["ADSL"]], c("AGE", "SEX", "RACE")), #' selected = "AGE", #' multiple = TRUE, #' fixed = FALSE diff --git a/R/tm_g_association.R b/R/tm_g_association.R index 51c2b903f..f3820212c 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -43,7 +43,7 @@ #' select = teal.transform::select_spec( #' label = "Select variable:", #' choices = teal.transform::variable_choices( -#' data@env$ADSL, +#' data[["ADSL"]], #' c("SEX", "RACE", "COUNTRY", "ARM", "STRATA1", "STRATA2", "ITTFL", "BMRKR2") #' ), #' selected = "RACE", @@ -55,7 +55,7 @@ #' select = teal.transform::select_spec( #' label = "Select variables:", #' choices = teal.transform::variable_choices( -#' data@env$ADSL, +#' data[["ADSL"]], #' c("SEX", "RACE", "COUNTRY", "ARM", "STRATA1", "STRATA2", "ITTFL", "BMRKR2") #' ), #' selected = "BMRKR2", diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index 67c44a28f..7bf003a2e 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -62,7 +62,7 @@ #' dataname = "ADSL", #' select = teal.transform::select_spec( #' label = "Select variable:", -#' choices = teal.transform::variable_choices(data@env$ADSL), +#' choices = teal.transform::variable_choices(data[["ADSL"]]), #' selected = "AGE", #' fixed = FALSE #' ) @@ -71,7 +71,7 @@ #' dataname = "ADSL", #' select = teal.transform::select_spec( #' label = "Select variable:", -#' choices = teal.transform::variable_choices(data@env$ADSL), +#' choices = teal.transform::variable_choices(data[["ADSL"]]), #' selected = "SEX", #' multiple = FALSE, #' fixed = FALSE @@ -81,7 +81,7 @@ #' dataname = "ADSL", #' select = teal.transform::select_spec( #' label = "Select variable:", -#' choices = teal.transform::variable_choices(data@env$ADSL), +#' choices = teal.transform::variable_choices(data[["ADSL"]]), #' selected = "ARM", #' fixed = FALSE #' ) @@ -90,7 +90,7 @@ #' dataname = "ADSL", #' select = teal.transform::select_spec( #' label = "Select variable:", -#' choices = teal.transform::variable_choices(data@env$ADSL), +#' choices = teal.transform::variable_choices(data[["ADSL"]]), #' selected = "COUNTRY", #' fixed = FALSE #' ) diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 7b09c01d8..8069530f6 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -63,7 +63,7 @@ #' datanames(data) <- datanames #' data@join_keys <- cdisc_join_keys(!!!datanames) #' -#' vars1 <- choices_selected(variable_choices(data@env$ADSL, c("ARM", "COUNTRY", "SEX")), selected = NULL) +#' vars1 <- choices_selected(variable_choices(data[["ADSL"]], c("ARM", "COUNTRY", "SEX")), selected = NULL) #' #' app <- teal::init( #' data = data, @@ -72,7 +72,7 @@ #' dist_var = teal.transform::data_extract_spec( #' dataname = "ADSL", #' select = teal.transform::select_spec( -#' choices = teal.transform::variable_choices(data@env$ADSL, c("AGE", "BMRKR1")), +#' choices = teal.transform::variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")), #' selected = "BMRKR1", #' multiple = FALSE, #' fixed = FALSE diff --git a/R/tm_g_response.R b/R/tm_g_response.R index cb9b469a9..01ce93621 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -38,7 +38,7 @@ #' #' app <- teal::init( #' data = teal.data::cdisc_data( -#' teal.data::cdisc_dataset("ADSL", data@env$ADSL, code = "ADSL <- teal.modules.general::rADSL"), +#' teal.data::cdisc_dataset("ADSL", data[["ADSL"]], code = "ADSL <- teal.modules.general::rADSL"), #' check = TRUE #' ), #' modules = teal::modules( @@ -48,7 +48,7 @@ #' dataname = "ADSL", #' select = teal.transform::select_spec( #' label = "Select variable:", -#' choices = teal.transform::variable_choices(data@env$ADSL, c("BMRKR2", "COUNTRY")), +#' choices = teal.transform::variable_choices(data[["ADSL"]], c("BMRKR2", "COUNTRY")), #' selected = "BMRKR2", #' multiple = FALSE, #' fixed = FALSE @@ -58,7 +58,7 @@ #' dataname = "ADSL", #' select = teal.transform::select_spec( #' label = "Select variable:", -#' choices = teal.transform::variable_choices(data@env$ADSL, c("SEX", "RACE")), +#' choices = teal.transform::variable_choices(data[["ADSL"]], c("SEX", "RACE")), #' selected = "RACE", #' multiple = FALSE, #' fixed = FALSE diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index 8642b98cb..2022f05c2 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -56,7 +56,7 @@ #' select = teal.transform::select_spec( #' label = "Select variable:", #' choices = teal.transform::variable_choices( -#' data@env$ADSL, +#' data[["ADSL"]], #' c("AGE", "BMRKR1", "BMRKR2") #' ), #' selected = "AGE", @@ -69,7 +69,7 @@ #' select = teal.transform::select_spec( #' label = "Select variable:", #' choices = teal.transform::variable_choices( -#' data@env$ADSL, +#' data[["ADSL"]], #' c("AGE", "BMRKR1", "BMRKR2") #' ), #' selected = "BMRKR1", @@ -82,7 +82,7 @@ #' select = teal.transform::select_spec( #' label = "Select variable:", #' choices = teal.transform::variable_choices( -#' data@env$ADSL, +#' data[["ADSL"]], #' c("AGE", "BMRKR1", "BMRKR2", "RACE", "REGION1") #' ), #' selected = NULL, @@ -95,7 +95,7 @@ #' select = teal.transform::select_spec( #' label = "Select variable:", #' choices = teal.transform::variable_choices( -#' data@env$ADSL, +#' data[["ADSL"]], #' c("AGE", "BMRKR1", "BMRKR2", "RACE", "REGION1") #' ), #' selected = "AGE", @@ -108,7 +108,7 @@ #' select = teal.transform::select_spec( #' label = "Select variable:", #' choices = teal.transform::variable_choices( -#' data@env$ADSL, +#' data[["ADSL"]], #' c("BMRKR2", "RACE", "REGION1") #' ), #' selected = NULL, @@ -121,7 +121,7 @@ #' select = teal.transform::select_spec( #' label = "Select variable:", #' choices = teal.transform::variable_choices( -#' data@env$ADSL, +#' data[["ADSL"]], #' c("BMRKR2", "RACE", "REGION1") #' ), #' selected = NULL, diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index f39793fb1..ec60ba094 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -39,7 +39,7 @@ #' dataname = "ADSL", #' select = select_spec( #' label = "Select variables:", -#' choices = variable_choices(data@env$ADSL), +#' choices = variable_choices(data[["ADSL"]]), #' selected = c("AGE", "RACE", "SEX"), #' multiple = TRUE, #' ordered = TRUE, @@ -51,13 +51,13 @@ #' filter = teal.transform::filter_spec( #' label = "Select endpoints:", #' vars = c("PARAMCD", "AVISIT"), -#' choices = value_choices(data@env$ADRS, c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), +#' choices = value_choices(data[["ADRS"]], c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), #' selected = "INVET - END OF INDUCTION", #' multiple = TRUE #' ), #' select = select_spec( #' label = "Select variables:", -#' choices = variable_choices(data@env$ADRS), +#' choices = variable_choices(data[["ADRS"]]), #' selected = c("AGE", "AVAL", "ADY"), #' multiple = TRUE, #' ordered = TRUE, diff --git a/R/tm_outliers.R b/R/tm_outliers.R index d8cfca971..59004e1cd 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -25,8 +25,8 @@ #' datanames(data) <- datanames #' data@join_keys <- cdisc_join_keys(!!!datanames) #' -#' fact_vars_adsl <- names(Filter(isTRUE, sapply(data@env$ADSL, is.factor))) -#' vars <- choices_selected(variable_choices(data@env$ADSL, fact_vars_adsl)) +#' fact_vars_adsl <- names(Filter(isTRUE, sapply(data[["ADSL"]], is.factor))) +#' vars <- choices_selected(variable_choices(data[["ADSL"]], fact_vars_adsl)) #' #' app <- teal::init( #' data = data, @@ -37,7 +37,7 @@ #' dataname = "ADSL", #' select = select_spec( #' label = "Select variable:", -#' choices = variable_choices(data@env$ADSL, c("AGE", "BMRKR1")), +#' choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")), #' selected = "AGE", #' multiple = FALSE, #' fixed = FALSE @@ -49,8 +49,8 @@ #' dataname = "ADSL", #' filter = teal.transform::filter_spec( #' vars = vars, -#' choices = value_choices(data@env$ADSL, vars$selected), -#' selected = value_choices(data@env$ADSL, vars$selected), +#' choices = value_choices(data[["ADSL"]], vars$selected), +#' selected = value_choices(data[["ADSL"]], vars$selected), #' multiple = TRUE #' ) #' ) diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 7d123c296..afbb85f33 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -33,7 +33,7 @@ #' #' app <- teal::init( #' data = teal.data::cdisc_data( -#' teal.data::cdisc_dataset("ADSL", data@env$ADSL, code = "ADSL <- teal.modules.general::rADSL"), +#' teal.data::cdisc_dataset("ADSL", data[["ADSL"]], code = "ADSL <- teal.modules.general::rADSL"), #' check = TRUE #' ), #' modules = teal::modules( @@ -43,7 +43,7 @@ #' dataname = "ADSL", #' select = teal.transform::select_spec( #' label = "Select variable:", -#' choices = variable_choices(data@env$ADSL, subset = function(data) { +#' choices = variable_choices(data[["ADSL"]], subset = function(data) { #' idx <- !vapply(data, inherits, logical(1), c("Date", "POSIXct", "POSIXlt")) #' return(names(data)[idx]) #' }), @@ -57,7 +57,7 @@ #' dataname = "ADSL", #' select = teal.transform::select_spec( #' label = "Select variable:", -#' choices = variable_choices(data@env$ADSL, subset = function(data) { +#' choices = variable_choices(data[["ADSL"]], subset = function(data) { #' idx <- vapply(data, is.factor, logical(1)) #' return(names(data)[idx]) #' }), diff --git a/man/tm_a_pca.Rd b/man/tm_a_pca.Rd index 2e7a6d466..b10a1168b 100644 --- a/man/tm_a_pca.Rd +++ b/man/tm_a_pca.Rd @@ -89,7 +89,7 @@ app <- teal::init( dat = teal.transform::data_extract_spec( dataname = "ADSL", select = teal.transform::select_spec( - choices = teal.transform::variable_choices(data = data@env$ADSL, c("BMRKR1", "AGE", "EOSDY")), + choices = teal.transform::variable_choices(data = data[["ADSL"]], c("BMRKR1", "AGE", "EOSDY")), selected = c("BMRKR1", "AGE"), multiple = TRUE ), diff --git a/man/tm_a_regression.Rd b/man/tm_a_regression.Rd index 161ee3a8f..f11861f0d 100644 --- a/man/tm_a_regression.Rd +++ b/man/tm_a_regression.Rd @@ -115,7 +115,7 @@ app <- teal::init( dataname = "ADSL", select = teal.transform::select_spec( label = "Select variables:", - choices = teal.transform::variable_choices(data@env$ADSL, c("AGE", "SEX", "RACE")), + choices = teal.transform::variable_choices(data[["ADSL"]], c("AGE", "SEX", "RACE")), selected = "AGE", multiple = TRUE, fixed = FALSE diff --git a/man/tm_g_association.Rd b/man/tm_g_association.Rd index 4c48faca9..17551dc3c 100644 --- a/man/tm_g_association.Rd +++ b/man/tm_g_association.Rd @@ -89,7 +89,7 @@ app <- teal::init( select = teal.transform::select_spec( label = "Select variable:", choices = teal.transform::variable_choices( - data@env$ADSL, + data[["ADSL"]], c("SEX", "RACE", "COUNTRY", "ARM", "STRATA1", "STRATA2", "ITTFL", "BMRKR2") ), selected = "RACE", @@ -101,7 +101,7 @@ app <- teal::init( select = teal.transform::select_spec( label = "Select variables:", choices = teal.transform::variable_choices( - data@env$ADSL, + data[["ADSL"]], c("SEX", "RACE", "COUNTRY", "ARM", "STRATA1", "STRATA2", "ITTFL", "BMRKR2") ), selected = "BMRKR2", diff --git a/man/tm_g_bivariate.Rd b/man/tm_g_bivariate.Rd index 24bbf5798..055c3804a 100644 --- a/man/tm_g_bivariate.Rd +++ b/man/tm_g_bivariate.Rd @@ -130,7 +130,7 @@ app <- teal::init( dataname = "ADSL", select = teal.transform::select_spec( label = "Select variable:", - choices = teal.transform::variable_choices(data@env$ADSL), + choices = teal.transform::variable_choices(data[["ADSL"]]), selected = "AGE", fixed = FALSE ) @@ -139,7 +139,7 @@ app <- teal::init( dataname = "ADSL", select = teal.transform::select_spec( label = "Select variable:", - choices = teal.transform::variable_choices(data@env$ADSL), + choices = teal.transform::variable_choices(data[["ADSL"]]), selected = "SEX", multiple = FALSE, fixed = FALSE @@ -149,7 +149,7 @@ app <- teal::init( dataname = "ADSL", select = teal.transform::select_spec( label = "Select variable:", - choices = teal.transform::variable_choices(data@env$ADSL), + choices = teal.transform::variable_choices(data[["ADSL"]]), selected = "ARM", fixed = FALSE ) @@ -158,7 +158,7 @@ app <- teal::init( dataname = "ADSL", select = teal.transform::select_spec( label = "Select variable:", - choices = teal.transform::variable_choices(data@env$ADSL), + choices = teal.transform::variable_choices(data[["ADSL"]]), selected = "COUNTRY", fixed = FALSE ) diff --git a/man/tm_g_distribution.Rd b/man/tm_g_distribution.Rd index 121c1f1a7..515864736 100644 --- a/man/tm_g_distribution.Rd +++ b/man/tm_g_distribution.Rd @@ -107,7 +107,7 @@ datanames <- c("ADSL") datanames(data) <- datanames data@join_keys <- cdisc_join_keys(!!!datanames) -vars1 <- choices_selected(variable_choices(data@env$ADSL, c("ARM", "COUNTRY", "SEX")), selected = NULL) +vars1 <- choices_selected(variable_choices(data[["ADSL"]], c("ARM", "COUNTRY", "SEX")), selected = NULL) app <- teal::init( data = data, @@ -116,7 +116,7 @@ app <- teal::init( dist_var = teal.transform::data_extract_spec( dataname = "ADSL", select = teal.transform::select_spec( - choices = teal.transform::variable_choices(data@env$ADSL, c("AGE", "BMRKR1")), + choices = teal.transform::variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")), selected = "BMRKR1", multiple = FALSE, fixed = FALSE diff --git a/man/tm_g_response.Rd b/man/tm_g_response.Rd index d7ae034f4..569f1b650 100644 --- a/man/tm_g_response.Rd +++ b/man/tm_g_response.Rd @@ -97,7 +97,7 @@ data@join_keys <- cdisc_join_keys(!!!datanames) app <- teal::init( data = teal.data::cdisc_data( - teal.data::cdisc_dataset("ADSL", data@env$ADSL, code = "ADSL <- teal.modules.general::rADSL"), + teal.data::cdisc_dataset("ADSL", data[["ADSL"]], code = "ADSL <- teal.modules.general::rADSL"), check = TRUE ), modules = teal::modules( @@ -107,7 +107,7 @@ app <- teal::init( dataname = "ADSL", select = teal.transform::select_spec( label = "Select variable:", - choices = teal.transform::variable_choices(data@env$ADSL, c("BMRKR2", "COUNTRY")), + choices = teal.transform::variable_choices(data[["ADSL"]], c("BMRKR2", "COUNTRY")), selected = "BMRKR2", multiple = FALSE, fixed = FALSE @@ -117,7 +117,7 @@ app <- teal::init( dataname = "ADSL", select = teal.transform::select_spec( label = "Select variable:", - choices = teal.transform::variable_choices(data@env$ADSL, c("SEX", "RACE")), + choices = teal.transform::variable_choices(data[["ADSL"]], c("SEX", "RACE")), selected = "RACE", multiple = FALSE, fixed = FALSE diff --git a/man/tm_g_scatterplot.Rd b/man/tm_g_scatterplot.Rd index 2a43acf74..820992973 100644 --- a/man/tm_g_scatterplot.Rd +++ b/man/tm_g_scatterplot.Rd @@ -119,7 +119,7 @@ app <- teal::init( select = teal.transform::select_spec( label = "Select variable:", choices = teal.transform::variable_choices( - data@env$ADSL, + data[["ADSL"]], c("AGE", "BMRKR1", "BMRKR2") ), selected = "AGE", @@ -132,7 +132,7 @@ app <- teal::init( select = teal.transform::select_spec( label = "Select variable:", choices = teal.transform::variable_choices( - data@env$ADSL, + data[["ADSL"]], c("AGE", "BMRKR1", "BMRKR2") ), selected = "BMRKR1", @@ -145,7 +145,7 @@ app <- teal::init( select = teal.transform::select_spec( label = "Select variable:", choices = teal.transform::variable_choices( - data@env$ADSL, + data[["ADSL"]], c("AGE", "BMRKR1", "BMRKR2", "RACE", "REGION1") ), selected = NULL, @@ -158,7 +158,7 @@ app <- teal::init( select = teal.transform::select_spec( label = "Select variable:", choices = teal.transform::variable_choices( - data@env$ADSL, + data[["ADSL"]], c("AGE", "BMRKR1", "BMRKR2", "RACE", "REGION1") ), selected = "AGE", @@ -171,7 +171,7 @@ app <- teal::init( select = teal.transform::select_spec( label = "Select variable:", choices = teal.transform::variable_choices( - data@env$ADSL, + data[["ADSL"]], c("BMRKR2", "RACE", "REGION1") ), selected = NULL, @@ -184,7 +184,7 @@ app <- teal::init( select = teal.transform::select_spec( label = "Select variable:", choices = teal.transform::variable_choices( - data@env$ADSL, + data[["ADSL"]], c("BMRKR2", "RACE", "REGION1") ), selected = NULL, diff --git a/man/tm_g_scatterplotmatrix.Rd b/man/tm_g_scatterplotmatrix.Rd index 814a89f00..7eb858ab0 100644 --- a/man/tm_g_scatterplotmatrix.Rd +++ b/man/tm_g_scatterplotmatrix.Rd @@ -64,7 +64,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL), + choices = variable_choices(data[["ADSL"]]), selected = c("AGE", "RACE", "SEX"), multiple = TRUE, ordered = TRUE, @@ -76,13 +76,13 @@ app <- teal::init( filter = teal.transform::filter_spec( label = "Select endpoints:", vars = c("PARAMCD", "AVISIT"), - choices = value_choices(data@env$ADRS, c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), + choices = value_choices(data[["ADRS"]], c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), selected = "INVET - END OF INDUCTION", multiple = TRUE ), select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADRS), + choices = variable_choices(data[["ADRS"]]), selected = c("AGE", "AVAL", "ADY"), multiple = TRUE, ordered = TRUE, diff --git a/man/tm_outliers.Rd b/man/tm_outliers.Rd index 6e7a293cc..1c084a5a7 100644 --- a/man/tm_outliers.Rd +++ b/man/tm_outliers.Rd @@ -64,8 +64,8 @@ datanames <- c("ADSL") datanames(data) <- datanames data@join_keys <- cdisc_join_keys(!!!datanames) -fact_vars_adsl <- names(Filter(isTRUE, sapply(data@env$ADSL, is.factor))) -vars <- choices_selected(variable_choices(data@env$ADSL, fact_vars_adsl)) +fact_vars_adsl <- names(Filter(isTRUE, sapply(data[["ADSL"]], is.factor))) +vars <- choices_selected(variable_choices(data[["ADSL"]], fact_vars_adsl)) app <- teal::init( data = data, @@ -76,7 +76,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("AGE", "BMRKR1")), + choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")), selected = "AGE", multiple = FALSE, fixed = FALSE @@ -88,8 +88,8 @@ app <- teal::init( dataname = "ADSL", filter = teal.transform::filter_spec( vars = vars, - choices = value_choices(data@env$ADSL, vars$selected), - selected = value_choices(data@env$ADSL, vars$selected), + choices = value_choices(data[["ADSL"]], vars$selected), + selected = value_choices(data[["ADSL"]], vars$selected), multiple = TRUE ) ) diff --git a/man/tm_t_crosstable.Rd b/man/tm_t_crosstable.Rd index f7f0a0084..94a8555b4 100644 --- a/man/tm_t_crosstable.Rd +++ b/man/tm_t_crosstable.Rd @@ -65,7 +65,7 @@ data@join_keys <- cdisc_join_keys(!!!datanames) app <- teal::init( data = teal.data::cdisc_data( - teal.data::cdisc_dataset("ADSL", data@env$ADSL, code = "ADSL <- teal.modules.general::rADSL"), + teal.data::cdisc_dataset("ADSL", data[["ADSL"]], code = "ADSL <- teal.modules.general::rADSL"), check = TRUE ), modules = teal::modules( @@ -75,7 +75,7 @@ app <- teal::init( dataname = "ADSL", select = teal.transform::select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, subset = function(data) { + choices = variable_choices(data[["ADSL"]], subset = function(data) { idx <- !vapply(data, inherits, logical(1), c("Date", "POSIXct", "POSIXlt")) return(names(data)[idx]) }), @@ -89,7 +89,7 @@ app <- teal::init( dataname = "ADSL", select = teal.transform::select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, subset = function(data) { + choices = variable_choices(data[["ADSL"]], subset = function(data) { idx <- vapply(data, is.factor, logical(1)) return(names(data)[idx]) }), diff --git a/vignettes/teal-modules-general.Rmd b/vignettes/teal-modules-general.Rmd index 8292e1aeb..7aaf5c47c 100644 --- a/vignettes/teal-modules-general.Rmd +++ b/vignettes/teal-modules-general.Rmd @@ -83,6 +83,7 @@ so both the code and data are stored together. Following this, we set the `datanames` and `join_keys`. ```r +# nolint start data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -91,6 +92,7 @@ data <- within(data, { datanames <- c("ADSL", "ADTTE") datanames(data) <- datanames data@join_keys <- cdisc_join_keys(!!!datanames) +# nolint end ``` There is no need to load `teal` as `teal.modules.general` already depends on it. diff --git a/vignettes/using-association-plot.Rmd b/vignettes/using-association-plot.Rmd index ce5e32321..823625feb 100644 --- a/vignettes/using-association-plot.Rmd +++ b/vignettes/using-association-plot.Rmd @@ -61,6 +61,7 @@ itself will be constructed by multiple calls of `tm_g_association` using differe combinations of data sets. ```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +# nolint start data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -81,6 +82,8 @@ data@join_keys <- cdisc_join_keys(!!!datanames) data@join_keys$mutate( "ADSL2", "ADSL", get_cdisc_keys("ADSL") ) +# nolint end + app <- teal::init( data = data, modules = teal::modules( @@ -93,7 +96,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL), + choices = variable_choices(data[["ADSL"]]), selected = "AGE", fixed = FALSE ) @@ -102,7 +105,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL), + choices = variable_choices(data[["ADSL"]]), selected = "BMRKR1", multiple = TRUE, fixed = FALSE @@ -115,7 +118,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("AGE", "SEX", "STRATA1", "RACE")), + choices = variable_choices(data[["ADSL"]], c("AGE", "SEX", "STRATA1", "RACE")), selected = "STRATA1", multiple = FALSE, fixed = FALSE @@ -125,7 +128,7 @@ app <- teal::init( dataname = "ADSL2", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL2, c("AGE", "SEX", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL2"]], c("AGE", "SEX", "RACE", "COUNTRY")), selected = c("AGE", "COUNTRY", "RACE"), multiple = TRUE, fixed = FALSE @@ -138,7 +141,7 @@ app <- teal::init( dataname = "ADTTE", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADTTE), + choices = variable_choices(data[["ADTTE"]]), selected = "AVAL", multiple = FALSE, fixed = FALSE @@ -146,7 +149,7 @@ app <- teal::init( filter = teal.transform::filter_spec( label = "Select endpoint:", vars = "PARAMCD", - choices = value_choices(data@env$ADTTE, "PARAMCD", "PARAM"), + choices = value_choices(data[["ADTTE"]], "PARAMCD", "PARAM"), selected = c("PFS", "EFS"), multiple = TRUE ) @@ -156,7 +159,7 @@ app <- teal::init( reshape = TRUE, select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADRS, c("AVALC", "BMRKR1", "BMRKR2", "ARM")), + choices = variable_choices(data[["ADRS"]], c("AVALC", "BMRKR1", "BMRKR2", "ARM")), selected = "AVALC", multiple = TRUE, fixed = FALSE @@ -165,14 +168,14 @@ app <- teal::init( filter_spec( label = "Select endpoints:", vars = "PARAMCD", - choices = value_choices(data@env$ADRS, "PARAMCD", "PARAM"), + choices = value_choices(data[["ADRS"]], "PARAMCD", "PARAM"), selected = "BESRSPI", multiple = TRUE ), filter_spec( label = "Select endpoints:", vars = "AVISIT", - choices = levels(data@env$ADRS$AVISIT), + choices = levels(data[["ADRS"]]$AVISIT), selected = "SCREENING", multiple = TRUE ) @@ -184,7 +187,7 @@ app <- teal::init( ref = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("AVAL", "AVALC")), + choices = variable_choices(data[["ADRS"]], c("AVAL", "AVALC")), selected = "AVALC", multiple = FALSE, fixed = FALSE, @@ -193,15 +196,15 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADRS, "PARAMCD", "PARAM"), - selected = levels(data@env$ADRS$PARAMCD), + choices = value_choices(data[["ADRS"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADRS"]]$PARAMCD), multiple = TRUE, label = "Select response" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADRS$AVISIT), - selected = levels(data@env$ADRS$AVISIT), + choices = levels(data[["ADRS"]]$AVISIT), + selected = levels(data[["ADRS"]]$AVISIT), multiple = TRUE, label = "Select visit:" ) @@ -210,7 +213,7 @@ app <- teal::init( vars = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("SEX", "AGE", "RACE", "COUNTRY", "BMRKR1", "STRATA1", "ARM")), + choices = variable_choices(data[["ADSL"]], c("SEX", "AGE", "RACE", "COUNTRY", "BMRKR1", "STRATA1", "ARM")), selected = "AGE", multiple = TRUE, fixed = FALSE, @@ -223,7 +226,7 @@ app <- teal::init( ref = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS), + choices = variable_choices(data[["ADRS"]]), selected = "AVALC", multiple = FALSE, fixed = FALSE, @@ -233,7 +236,7 @@ app <- teal::init( vars = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS), + choices = variable_choices(data[["ADRS"]]), selected = "PARAMCD", multiple = TRUE, fixed = FALSE, @@ -248,21 +251,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) ), select = select_spec( - choices = variable_choices(data@env$ADLB, c("AVAL", "CHG2", "PCHG2")), + choices = variable_choices(data[["ADLB"]], c("AVAL", "CHG2", "PCHG2")), selected = "AVAL", multiple = FALSE ) @@ -272,21 +275,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select labs:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) ), select = select_spec( - choices = variable_choices(data@env$ADLB), + choices = variable_choices(data[["ADLB"]]), selected = "STRATA1", multiple = TRUE ) diff --git a/vignettes/using-bivariate-plot.Rmd b/vignettes/using-bivariate-plot.Rmd index adbeed28d..2a87d819d 100644 --- a/vignettes/using-bivariate-plot.Rmd +++ b/vignettes/using-bivariate-plot.Rmd @@ -41,6 +41,7 @@ Inside this app 5 datasets will be used 5. `ADLB` A long data set with lab measurements for each subject ```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +# nolint start data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -61,6 +62,7 @@ data@join_keys <- cdisc_join_keys(!!!datanames) data@join_keys$mutate( "ADSL2", "ADSL", get_cdisc_keys("ADSL") ) +# nolint end ``` ## Create an `app` variable @@ -83,7 +85,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL), + choices = variable_choices(data[["ADSL"]]), selected = "BMRKR1", fixed = FALSE ) @@ -92,7 +94,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL), + choices = variable_choices(data[["ADSL"]]), selected = "SEX", multiple = FALSE, fixed = FALSE @@ -102,7 +104,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL), + choices = variable_choices(data[["ADSL"]]), selected = NULL, multiple = FALSE, fixed = FALSE @@ -112,7 +114,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL), + choices = variable_choices(data[["ADSL"]]), selected = NULL, multiple = FALSE, fixed = FALSE @@ -125,7 +127,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("BMRKR1", "AGE", "SEX", "STRATA1", "RACE")), + choices = variable_choices(data[["ADSL"]], c("BMRKR1", "AGE", "SEX", "STRATA1", "RACE")), selected = c("BMRKR1"), multiple = FALSE ) @@ -134,7 +136,7 @@ app <- teal::init( dataname = "ADSL2", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL2, c("COUNTRY", "AGE", "RACE")), + choices = variable_choices(data[["ADSL2"]], c("COUNTRY", "AGE", "RACE")), selected = "RACE", multiple = FALSE ) @@ -143,7 +145,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL), + choices = variable_choices(data[["ADSL"]]), selected = NULL, multiple = FALSE, fixed = FALSE @@ -153,7 +155,7 @@ app <- teal::init( dataname = "ADSL2", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL2), + choices = variable_choices(data[["ADSL2"]]), selected = NULL, multiple = FALSE, fixed = FALSE @@ -167,12 +169,12 @@ app <- teal::init( filter = teal.transform::filter_spec( label = "Select endpoints:", vars = c("PARAMCD", "AVISIT"), - choices = value_choices(data@env$ADRS, c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), + choices = value_choices(data[["ADRS"]], c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), selected = "OVRINV - END OF INDUCTION", multiple = TRUE ), select = select_spec( - choices = variable_choices(data@env$ADRS, c("AVALC", "AVAL")), + choices = variable_choices(data[["ADRS"]], c("AVALC", "AVAL")), selected = "AVALC", multiple = FALSE ) @@ -181,7 +183,7 @@ app <- teal::init( dataname = "ADTTE", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADTTE, c("AVAL", "CNSR")), + choices = variable_choices(data[["ADTTE"]], c("AVAL", "CNSR")), selected = "AVAL", multiple = FALSE, fixed = FALSE @@ -189,7 +191,7 @@ app <- teal::init( filter = teal.transform::filter_spec( label = "Select endpoint:", vars = c("PARAMCD"), - choices = value_choices(data@env$ADTTE, "PARAMCD", "PARAM"), + choices = value_choices(data[["ADTTE"]], "PARAMCD", "PARAM"), selected = "OS", multiple = FALSE ) @@ -199,13 +201,13 @@ app <- teal::init( filter = teal.transform::filter_spec( label = "Select endpoints:", vars = c("PARAMCD", "AVISIT"), - choices = value_choices(data@env$ADRS, c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), + choices = value_choices(data[["ADRS"]], c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), selected = "OVRINV - SCREENING", multiple = TRUE ), select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADRS, c("SEX", "RACE", "COUNTRY", "ARM", "PARAMCD", "AVISIT")), + choices = variable_choices(data[["ADRS"]], c("SEX", "RACE", "COUNTRY", "ARM", "PARAMCD", "AVISIT")), selected = "SEX", multiple = FALSE, fixed = FALSE @@ -215,7 +217,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL, c("SEX", "RACE")), + choices = variable_choices(data[["ADSL"]], c("SEX", "RACE")), selected = NULL, multiple = FALSE, fixed = FALSE @@ -225,7 +227,7 @@ app <- teal::init( color = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("SEX", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("SEX", "RACE", "COUNTRY")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -235,7 +237,7 @@ app <- teal::init( fill = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("SEX", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("SEX", "RACE", "COUNTRY")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -245,7 +247,7 @@ app <- teal::init( size = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("AGE", "BMRKR1")), + choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -262,21 +264,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADRS, "PARAMCD", "PARAM"), - selected = levels(data@env$ADRS$PARAMCD)[1], + choices = value_choices(data[["ADRS"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADRS"]]$PARAMCD)[1], multiple = FALSE, label = "Select response:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADRS$AVISIT), - selected = levels(data@env$ADRS$AVISIT)[1], + choices = levels(data[["ADRS"]]$AVISIT), + selected = levels(data[["ADRS"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) ), select = select_spec( - choices = variable_choices(data@env$ADRS, c("AVALC", "AVAL")), + choices = variable_choices(data[["ADRS"]], c("AVALC", "AVAL")), selected = "AVALC", multiple = FALSE, label = "Select variable:" @@ -285,7 +287,7 @@ app <- teal::init( y = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("BMRKR1", "SEX", "AGE", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("BMRKR1", "SEX", "AGE", "RACE", "COUNTRY")), selected = "BMRKR1", multiple = FALSE, label = "Select variable:", @@ -295,7 +297,7 @@ app <- teal::init( row_facet = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("SEX", "RACE", "ARMCD", "PARAMCD")), + choices = variable_choices(data[["ADRS"]], c("SEX", "RACE", "ARMCD", "PARAMCD")), selected = "SEX", multiple = FALSE, label = "Select variable:" @@ -304,7 +306,7 @@ app <- teal::init( col_facet = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("SEX", "RACE", "ARMCD", "PARAMCD", "AVISIT")), + choices = variable_choices(data[["ADRS"]], c("SEX", "RACE", "ARMCD", "PARAMCD", "AVISIT")), selected = "ARMCD", multiple = FALSE, fixed = FALSE, @@ -319,21 +321,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADRS, "PARAMCD", "PARAM"), - selected = levels(data@env$ADRS$PARAMCD)[1], + choices = value_choices(data[["ADRS"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADRS"]]$PARAMCD)[1], multiple = FALSE, label = "Select response:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADRS$AVISIT), - selected = levels(data@env$ADRS$AVISIT)[1], + choices = levels(data[["ADRS"]]$AVISIT), + selected = levels(data[["ADRS"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) ), select = select_spec( - choices = variable_choices(data@env$ADRS, c("AVALC", "AVAL")), + choices = variable_choices(data[["ADRS"]], c("AVALC", "AVAL")), selected = "AVALC", multiple = FALSE, label = "Select variable:" @@ -342,7 +344,7 @@ app <- teal::init( y = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("BMRKR1", "SEX", "AGE", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("BMRKR1", "SEX", "AGE", "RACE", "COUNTRY")), selected = "BMRKR1", multiple = FALSE, fixed = FALSE @@ -353,15 +355,15 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select measurement:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) @@ -377,7 +379,7 @@ app <- teal::init( col_facet = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("SEX", "AGE", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("SEX", "AGE", "RACE", "COUNTRY")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -388,7 +390,7 @@ app <- teal::init( color = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("SEX", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("SEX", "RACE", "COUNTRY")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -398,7 +400,7 @@ app <- teal::init( fill = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("SEX", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("SEX", "RACE", "COUNTRY")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -408,7 +410,7 @@ app <- teal::init( size = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("AGE", "BMRKR1")), + choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -423,7 +425,7 @@ app <- teal::init( x = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("AVALC", "AVAL")), + choices = variable_choices(data[["ADRS"]], c("AVALC", "AVAL")), selected = "AVALC", multiple = FALSE, fixed = FALSE, @@ -433,7 +435,7 @@ app <- teal::init( y = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("SEX", "RACE", "COUNTRY", "ARMCD", "BMRKR1", "BMRKR2")), + choices = variable_choices(data[["ADRS"]], c("SEX", "RACE", "COUNTRY", "ARMCD", "BMRKR1", "BMRKR2")), selected = "BMRKR1", multiple = FALSE, fixed = FALSE, @@ -443,7 +445,7 @@ app <- teal::init( row_facet = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("AVISIT", "PARAMCD")), + choices = variable_choices(data[["ADRS"]], c("AVISIT", "PARAMCD")), selected = "PARAMCD", multiple = FALSE, label = "Select variables:" @@ -452,7 +454,7 @@ app <- teal::init( col_facet = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("AVISIT", "PARAMCD")), + choices = variable_choices(data[["ADRS"]], c("AVISIT", "PARAMCD")), selected = "AVISIT", multiple = FALSE, label = "Select variables:" @@ -466,15 +468,15 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) @@ -491,15 +493,15 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) @@ -517,21 +519,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select category:" ) ), select = select_spec( - choices = variable_choices(data@env$ADLB, c("RACE", "SEX", "ARMCD", "ACTARMCD")), + choices = variable_choices(data[["ADLB"]], c("RACE", "SEX", "ARMCD", "ACTARMCD")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -543,21 +545,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select category:" ) ), select = select_spec( - choices = variable_choices(data@env$ADLB, c("RACE", "SEX", "ARMCD", "ACTARMCD")), + choices = variable_choices(data[["ADLB"]], c("RACE", "SEX", "ARMCD", "ACTARMCD")), selected = "ARMCD", multiple = FALSE, fixed = FALSE, @@ -568,7 +570,7 @@ app <- teal::init( color = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("SEX", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("SEX", "RACE", "COUNTRY")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -578,7 +580,7 @@ app <- teal::init( fill = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("SEX", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("SEX", "RACE", "COUNTRY")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -588,7 +590,7 @@ app <- teal::init( size = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("AGE", "BMRKR1")), + choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")), selected = NULL, multiple = FALSE, fixed = FALSE, diff --git a/vignettes/using-cross-table.Rmd b/vignettes/using-cross-table.Rmd index d8cc65230..1d4c2c8eb 100644 --- a/vignettes/using-cross-table.Rmd +++ b/vignettes/using-cross-table.Rmd @@ -35,6 +35,7 @@ Inside this app 2 datasets will be used 2. `ADLB` A long data set with lab measurements for each subject ```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide", echo=2:6} +# nolint start data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -48,6 +49,7 @@ data <- within(data, { datanames <- c("ADSL", "ADLB") datanames(data) <- datanames data@join_keys <- cdisc_join_keys(!!!datanames) +# nolint end ``` ## Create an `app` variable @@ -69,8 +71,8 @@ app <- teal::init( "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL), - selected = names(data@env$ADSL)[5], + choices = variable_choices(data[["ADSL"]]), + selected = names(data[["ADSL"]])[5], multiple = TRUE, fixed = FALSE, ordered = TRUE @@ -80,8 +82,8 @@ app <- teal::init( "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL), - selected = names(data@env$ADSL)[6], + choices = variable_choices(data[["ADSL"]]), + selected = names(data[["ADSL"]])[6], multiple = FALSE, fixed = FALSE ) @@ -93,12 +95,12 @@ app <- teal::init( dataname = "ADLB", filter = teal.transform::filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE ), select = select_spec( - choices = variable_choices(data@env$ADLB), + choices = variable_choices(data[["ADLB"]]), selected = "AVISIT", multiple = TRUE, fixed = FALSE, @@ -110,12 +112,12 @@ app <- teal::init( dataname = "ADLB", filter = teal.transform::filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE ), select = select_spec( - choices = variable_choices(data@env$ADLB), + choices = variable_choices(data[["ADLB"]]), selected = "LOQFL", multiple = FALSE, fixed = FALSE, diff --git a/vignettes/using-data-table.Rmd b/vignettes/using-data-table.Rmd index 92f842416..2fd724f2d 100644 --- a/vignettes/using-data-table.Rmd +++ b/vignettes/using-data-table.Rmd @@ -35,6 +35,7 @@ Inside this app 3 datasets will be used 3. `ADLB` A long data set with lab measurements for each subject ```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +# nolint start data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -44,6 +45,7 @@ data <- within(data, { datanames <- c("ADSL", "ADTTE", "ADLB") datanames(data) <- datanames data@join_keys <- cdisc_join_keys(!!!datanames) +# nolint end ``` ## Create an `app` variable diff --git a/vignettes/using-outliers-module.Rmd b/vignettes/using-outliers-module.Rmd index 05abc5733..d2391c010 100644 --- a/vignettes/using-outliers-module.Rmd +++ b/vignettes/using-outliers-module.Rmd @@ -36,6 +36,7 @@ Inside this app 5 datasets will be used 3. `ADLB` A long data set with lab measurements for each subject ```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +# nolint start data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -45,6 +46,7 @@ data <- within(data, { datanames <- c("ADSL", "ADRS", "ADLB") datanames(data) <- datanames data@join_keys <- cdisc_join_keys(!!!datanames) +# nolint end ``` ## Create an `app` variable @@ -67,7 +69,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("AGE", "BMRKR1")), + choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")), selected = "AGE", fixed = FALSE ) @@ -77,8 +79,8 @@ app <- teal::init( select = select_spec( label = "Select variables:", choices = variable_choices( - data@env$ADSL, - subset = names(Filter(isTRUE, sapply(data@env$ADSL, is.factor))) + data[["ADSL"]], + subset = names(Filter(isTRUE, sapply(data[["ADSL"]], is.factor))) ), selected = "RACE", multiple = FALSE, @@ -93,7 +95,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("AGE", "BMRKR1")), + choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")), selected = "AGE", fixed = FALSE ) @@ -102,7 +104,7 @@ app <- teal::init( dataname = "ADLB", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADLB, c("AVAL", "CHG2")), + choices = variable_choices(data[["ADLB"]], c("AVAL", "CHG2")), selected = "AVAL", multiple = FALSE, fixed = FALSE @@ -115,8 +117,8 @@ app <- teal::init( select = select_spec( label = "Select variables:", choices = variable_choices( - data@env$ADSL, - subset = names(Filter(isTRUE, sapply(data@env$ADSL, is.factor))) + data[["ADSL"]], + subset = names(Filter(isTRUE, sapply(data[["ADSL"]], is.factor))) ), selected = "RACE", multiple = FALSE, @@ -131,7 +133,7 @@ app <- teal::init( dataname = "ADRS", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADRS, c("ADY", "EOSDY")), + choices = variable_choices(data[["ADRS"]], c("ADY", "EOSDY")), selected = "ADY", fixed = FALSE ) @@ -140,7 +142,7 @@ app <- teal::init( dataname = "ADLB", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADLB, c("AVAL", "CHG2")), + choices = variable_choices(data[["ADLB"]], c("AVAL", "CHG2")), selected = "AVAL", multiple = FALSE, fixed = FALSE @@ -152,7 +154,7 @@ app <- teal::init( dataname = "ADRS", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADRS, c("ARM", "ACTARM")), + choices = variable_choices(data[["ADRS"]], c("ARM", "ACTARM")), selected = "ARM", multiple = FALSE, fixed = FALSE @@ -163,8 +165,8 @@ app <- teal::init( select = select_spec( label = "Select variables:", choices = variable_choices( - data@env$ADLB, - subset = names(Filter(isTRUE, sapply(data@env$ADLB, is.factor))) + data[["ADLB"]], + subset = names(Filter(isTRUE, sapply(data[["ADLB"]], is.factor))) ), selected = "RACE", multiple = FALSE, diff --git a/vignettes/using-regression-plots.Rmd b/vignettes/using-regression-plots.Rmd index 776cd423b..415c670a3 100644 --- a/vignettes/using-regression-plots.Rmd +++ b/vignettes/using-regression-plots.Rmd @@ -39,6 +39,7 @@ Inside this app 5 datasets will be used 5. `ADLB` A long data set with lab measurements for each subject ```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +# nolint start data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -59,6 +60,7 @@ data@join_keys <- cdisc_join_keys(!!!datanames) data@join_keys$mutate( "ADSL2", "ADSL", get_cdisc_keys("ADSL") ) +# nolint end ``` ## Create an `app` variable @@ -80,7 +82,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("BMRKR1", "BMRKR2")), + choices = variable_choices(data[["ADSL"]], c("BMRKR1", "BMRKR2")), selected = "BMRKR1", multiple = FALSE, fixed = FALSE @@ -90,7 +92,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL, c("AGE", "SEX", "RACE")), + choices = variable_choices(data[["ADSL"]], c("AGE", "SEX", "RACE")), selected = "AGE", multiple = TRUE, fixed = FALSE @@ -104,7 +106,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("BMRKR1", "BMRKR2")), + choices = variable_choices(data[["ADSL"]], c("BMRKR1", "BMRKR2")), selected = "BMRKR1", multiple = FALSE, fixed = FALSE @@ -114,7 +116,7 @@ app <- teal::init( dataname = "ADSL2", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL2, c("AGE", "SEX", "RACE")), + choices = variable_choices(data[["ADSL2"]], c("AGE", "SEX", "RACE")), selected = c("AGE", "RACE"), multiple = TRUE, fixed = FALSE @@ -128,7 +130,7 @@ app <- teal::init( dataname = "ADTTE", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADTTE, c("AVAL", "CNSR")), + choices = variable_choices(data[["ADTTE"]], c("AVAL", "CNSR")), selected = "AVAL", multiple = FALSE, fixed = FALSE @@ -136,7 +138,7 @@ app <- teal::init( filter = teal.transform::filter_spec( label = "Select parameter:", vars = "PARAMCD", - choices = value_choices(data@env$ADTTE, "PARAMCD", "PARAM"), + choices = value_choices(data[["ADTTE"]], "PARAMCD", "PARAM"), selected = "PFS", multiple = FALSE ) @@ -145,14 +147,14 @@ app <- teal::init( dataname = "ADTTE", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADTTE, c("AGE", "CNSR", "SEX")), + choices = variable_choices(data[["ADTTE"]], c("AGE", "CNSR", "SEX")), selected = c("AGE", "CNSR", "SEX"), multiple = TRUE ), filter = teal.transform::filter_spec( label = "Select parameter:", vars = "PARAMCD", - choices = value_choices(data@env$ADTTE, "PARAMCD", "PARAM"), + choices = value_choices(data[["ADTTE"]], "PARAMCD", "PARAM"), selected = "PFS", multiple = FALSE ) @@ -165,15 +167,15 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[2], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[2], multiple = TRUE, label = "Select measurement:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[2], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[2], multiple = TRUE, label = "Select visit:" ) @@ -190,7 +192,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL, c("BMRKR1", "BMRKR2", "AGE")), + choices = variable_choices(data[["ADSL"]], c("BMRKR1", "BMRKR2", "AGE")), selected = "AGE", multiple = TRUE, fixed = FALSE @@ -205,15 +207,15 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = TRUE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = TRUE, label = "Select visit:" ) @@ -230,21 +232,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select labs:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) ), select = select_spec( - choices = variable_choices(data@env$ADLB, c("AVAL", "AGE", "BMRKR1", "BMRKR2", "SEX", "ARM")), + choices = variable_choices(data[["ADLB"]], c("AVAL", "AGE", "BMRKR1", "BMRKR2", "SEX", "ARM")), selected = c("AVAL", "BMRKR1"), multiple = TRUE ) diff --git a/vignettes/using-response-plot.Rmd b/vignettes/using-response-plot.Rmd index 698f5ca36..52a1a5e18 100644 --- a/vignettes/using-response-plot.Rmd +++ b/vignettes/using-response-plot.Rmd @@ -38,6 +38,7 @@ Inside this app 5 datasets will be used 5. `ADLB` A long data set with lab measurements for each subject ```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +# nolint start data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -58,6 +59,7 @@ data@join_keys <- cdisc_join_keys(!!!datanames) data@join_keys$mutate( "ADSL2", "ADSL", get_cdisc_keys("ADSL") ) +# nolint end ``` ## Create an `app` variable @@ -79,7 +81,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("BMRKR2", "ITTFL", "BEP01FL")), + choices = variable_choices(data[["ADSL"]], c("BMRKR2", "ITTFL", "BEP01FL")), selected = "BMRKR2", multiple = FALSE, fixed = FALSE @@ -89,7 +91,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("SEX", "RACE", "COUNTRY", "ARMCD", "STRATA1")), + choices = variable_choices(data[["ADSL"]], c("SEX", "RACE", "COUNTRY", "ARMCD", "STRATA1")), selected = "ARMCD", multiple = FALSE, fixed = FALSE @@ -102,7 +104,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("BMRKR2", "ITTFL", "BEP01FL")), + choices = variable_choices(data[["ADSL"]], c("BMRKR2", "ITTFL", "BEP01FL")), selected = "BMRKR2", multiple = FALSE ) @@ -125,21 +127,21 @@ app <- teal::init( filter_spec( label = "Select parameter:", vars = "PARAMCD", - choices = levels(data@env$ADLB$PARAMCD), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = levels(data[["ADLB"]]$PARAMCD), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE ), filter_spec( label = "Select visit:", vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE ) ), select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADLB, c("BMRKR2", "ITTFL", "BEP01FL")), + choices = variable_choices(data[["ADLB"]], c("BMRKR2", "ITTFL", "BEP01FL")), selected = "BMRKR2", multiple = FALSE ) @@ -150,15 +152,15 @@ app <- teal::init( filter_spec( label = "Select parameter:", vars = "PARAMCD", - choices = levels(data@env$ADRS$PARAMCD), - selected = levels(data@env$ADRS$PARAMCD)[3], + choices = levels(data[["ADRS"]]$PARAMCD), + selected = levels(data[["ADRS"]]$PARAMCD)[3], multiple = FALSE ), filter_spec( label = "Select visit:", vars = "AVISIT", - choices = levels(data@env$ADRS$AVISIT), - selected = levels(data@env$ADRS$AVISIT)[3], + choices = levels(data[["ADRS"]]$AVISIT), + selected = levels(data[["ADRS"]]$AVISIT)[3], multiple = FALSE ) ), @@ -182,7 +184,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("SEX", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("SEX", "COUNTRY")), selected = NULL, multiple = FALSE ) @@ -195,21 +197,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = levels(data@env$ADLB$PARAMCD), - selected = levels(data@env$ADLB$PARAMCD)[2], + choices = levels(data[["ADLB"]]$PARAMCD), + selected = levels(data[["ADLB"]]$PARAMCD)[2], multiple = TRUE, label = "Select measurement:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[2], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[2], multiple = TRUE, label = "Select visit:" ) ), select = select_spec( - choices = variable_choices(data@env$ADLB, c("BMRKR2", "ITTFL", "BEP01FL")), + choices = variable_choices(data[["ADLB"]], c("BMRKR2", "ITTFL", "BEP01FL")), selected = "BMRKR2", multiple = FALSE, fixed = FALSE, @@ -219,7 +221,7 @@ app <- teal::init( x = teal.transform::data_extract_spec( dataname = "ADSL", select = select_spec( - choices = variable_choices(data@env$ADSL, c("ARMCD", "BMRKR1", "BMRKR2", "BEP01FL")), + choices = variable_choices(data[["ADSL"]], c("ARMCD", "BMRKR1", "BMRKR2", "BEP01FL")), selected = "BMRKR2", multiple = FALSE, fixed = FALSE @@ -231,7 +233,7 @@ app <- teal::init( response = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("BMRKR2", "AVALC", "BEP01FL")), + choices = variable_choices(data[["ADRS"]], c("BMRKR2", "AVALC", "BEP01FL")), selected = "AVALC", multiple = FALSE, fixed = TRUE, @@ -241,7 +243,7 @@ app <- teal::init( x = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("AVALC", "AGE", "SEX", "ARMCD", "STRATA1")), + choices = variable_choices(data[["ADRS"]], c("AVALC", "AGE", "SEX", "ARMCD", "STRATA1")), selected = "ARMCD", multiple = FALSE, fixed = FALSE, @@ -275,8 +277,8 @@ app <- teal::init( dataname = "ADLB", filter = teal.transform::filter_spec( vars = "PARAMCD", - choices = levels(data@env$ADLB$PARAMCD), - selected = levels(data@env$ADLB$PARAMCD)[2], + choices = levels(data[["ADLB"]]$PARAMCD), + selected = levels(data[["ADLB"]]$PARAMCD)[2], multiple = FALSE, label = "Select lab:" ), @@ -291,13 +293,13 @@ app <- teal::init( dataname = "ADLB", filter = teal.transform::filter_spec( vars = "PARAMCD", - choices = levels(data@env$ADLB$PARAMCD), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = levels(data[["ADLB"]]$PARAMCD), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), select = select_spec( - choices = variable_choices(data@env$ADLB, c("AVISIT", "PARAMCD", "BEP01FL")), + choices = variable_choices(data[["ADLB"]], c("AVISIT", "PARAMCD", "BEP01FL")), selected = "AVISIT", multiple = FALSE, fixed = TRUE @@ -308,21 +310,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = levels(data@env$ADLB$PARAMCD), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = levels(data[["ADLB"]]$PARAMCD), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) ), select = select_spec( - choices = variable_choices(data@env$ADLB, c("SEX", "RACE", "ARMCD")), + choices = variable_choices(data[["ADLB"]], c("SEX", "RACE", "ARMCD")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -334,21 +336,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = levels(data@env$ADLB$PARAMCD), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = levels(data[["ADLB"]]$PARAMCD), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) ), select = select_spec( - choices = variable_choices(data@env$ADLB, c("SEX", "RACE", "ARMCD")), + choices = variable_choices(data[["ADLB"]], c("SEX", "RACE", "ARMCD")), selected = NULL, multiple = FALSE, fixed = FALSE, diff --git a/vignettes/using-scatterplot-matrix.Rmd b/vignettes/using-scatterplot-matrix.Rmd index 21d14c530..e92a83cd5 100644 --- a/vignettes/using-scatterplot-matrix.Rmd +++ b/vignettes/using-scatterplot-matrix.Rmd @@ -39,6 +39,7 @@ Inside this app 5 datasets will be used 5. `ADLB` A long data set with lab measurements for each subject ```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +# nolint start data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -59,6 +60,7 @@ data@join_keys <- cdisc_join_keys(!!!datanames) data@join_keys$mutate( "ADSL2", "ADSL", get_cdisc_keys("ADSL") ) +# nolint end ``` ## Create an `app` variable @@ -81,7 +83,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL), + choices = variable_choices(data[["ADSL"]]), selected = c("AGE", "RACE", "SEX", "BMRKR1", "BMRKR2"), multiple = TRUE, fixed = FALSE, @@ -96,7 +98,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL), + choices = variable_choices(data[["ADSL"]]), selected = c("AGE", "ACTARM", "SEX", "BMRKR1"), multiple = TRUE, fixed = FALSE, @@ -107,7 +109,7 @@ app <- teal::init( dataname = "ADSL2", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL2), + choices = variable_choices(data[["ADSL2"]]), selected = c("COUNTRY", "ACTARM", "STRATA1"), multiple = TRUE, fixed = FALSE, @@ -121,7 +123,7 @@ app <- teal::init( variables = teal.transform::data_extract_spec( dataname = "ADTTE", select = select_spec( - choices = variable_choices(data@env$ADTTE, c("AVAL", "BMRKR1", "BMRKR2")), + choices = variable_choices(data[["ADTTE"]], c("AVAL", "BMRKR1", "BMRKR2")), selected = c("AVAL", "BMRKR1", "BMRKR2"), multiple = TRUE, fixed = FALSE, @@ -137,7 +139,7 @@ app <- teal::init( dataname = "ADRS", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADRS), + choices = variable_choices(data[["ADRS"]]), selected = c("AVAL", "AVALC"), multiple = TRUE, fixed = FALSE, @@ -146,7 +148,7 @@ app <- teal::init( filter = teal.transform::filter_spec( label = "Select endpoints:", vars = c("PARAMCD", "AVISIT"), - choices = value_choices(data@env$ADRS, c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), + choices = value_choices(data[["ADRS"]], c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), selected = "OVRINV - SCREENING", multiple = FALSE ) @@ -155,7 +157,7 @@ app <- teal::init( dataname = "ADTTE", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADTTE), + choices = variable_choices(data[["ADTTE"]]), selected = c("AVAL", "CNSR"), multiple = TRUE, fixed = FALSE, @@ -164,7 +166,7 @@ app <- teal::init( filter = teal.transform::filter_spec( label = "Select parameters:", vars = "PARAMCD", - choices = value_choices(data@env$ADTTE, "PARAMCD", "PARAM"), + choices = value_choices(data[["ADTTE"]], "PARAMCD", "PARAM"), selected = "OS", multiple = TRUE ) diff --git a/vignettes/using-scatterplot.Rmd b/vignettes/using-scatterplot.Rmd index 344bc45fa..1e174541c 100644 --- a/vignettes/using-scatterplot.Rmd +++ b/vignettes/using-scatterplot.Rmd @@ -39,6 +39,7 @@ Inside this app 5 datasets will be used 5. `ADLB` A long data set with lab measurements for each subject ```{r echo=TRUE, message=FALSE, warning=FALSE, results="hide"} +# nolint start data <- teal_data() data <- within(data, { ADSL <- teal.modules.general::rADSL @@ -59,6 +60,7 @@ data@join_keys <- cdisc_join_keys(!!!datanames) data@join_keys$mutate( "ADSL2", "ADSL", get_cdisc_keys("ADSL") ) +# nolint end ``` ## Create an `app` variable @@ -86,7 +88,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("AGE", "BMRKR1", "BMRKR2")), + choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1", "BMRKR2")), selected = "AGE", multiple = FALSE, fixed = FALSE @@ -96,7 +98,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("AGE", "BMRKR1", "BMRKR2")), + choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1", "BMRKR2")), selected = "BMRKR1", multiple = FALSE, fixed = FALSE @@ -106,7 +108,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variables:", - choices = variable_choices(data@env$ADSL, c("RACE", "SEX")), + choices = variable_choices(data[["ADSL"]], c("RACE", "SEX")), selected = NULL, multiple = TRUE, fixed = FALSE @@ -120,7 +122,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("BMRKR1", "BMRKR2")), + choices = variable_choices(data[["ADSL"]], c("BMRKR1", "BMRKR2")), selected = "BMRKR1", multiple = FALSE, fixed = FALSE @@ -130,7 +132,7 @@ app <- teal::init( dataname = "ADSL2", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL2, c("AGE", "SEX")), + choices = variable_choices(data[["ADSL2"]], c("AGE", "SEX")), selected = "AGE", multiple = FALSE, fixed = FALSE @@ -140,7 +142,7 @@ app <- teal::init( dataname = "ADSL2", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL2, c("COUNTRY", "AGE", "RACE")), + choices = variable_choices(data[["ADSL2"]], c("COUNTRY", "AGE", "RACE")), selected = "COUNTRY", multiple = FALSE, fixed = FALSE @@ -153,7 +155,7 @@ app <- teal::init( dataname = "ADRS", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADRS), + choices = variable_choices(data[["ADRS"]]), selected = "AVAL", multiple = FALSE, fixed = FALSE @@ -161,7 +163,7 @@ app <- teal::init( filter = teal.transform::filter_spec( label = "Select endpoint:", vars = c("PARAMCD", "AVISIT"), - choices = value_choices(data@env$ADRS, c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), + choices = value_choices(data[["ADRS"]], c("PARAMCD", "AVISIT"), c("PARAM", "AVISIT")), selected = "OVRINV - SCREENING", multiple = FALSE ) @@ -170,7 +172,7 @@ app <- teal::init( dataname = "ADTTE", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADTTE), + choices = variable_choices(data[["ADTTE"]]), selected = "AVAL", multiple = FALSE, fixed = FALSE @@ -178,7 +180,7 @@ app <- teal::init( filter = teal.transform::filter_spec( label = "Select parameters:", vars = c("PARAMCD"), - choices = value_choices(data@env$ADTTE, "PARAMCD", "PARAM"), + choices = value_choices(data[["ADTTE"]], "PARAMCD", "PARAM"), selected = "OS", multiple = TRUE ) @@ -187,7 +189,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("AGE", "SEX")), + choices = variable_choices(data[["ADSL"]], c("AGE", "SEX")), selected = "AGE", multiple = FALSE, fixed = FALSE @@ -200,7 +202,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("SEX", "AGE", "BMRKR1", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("SEX", "AGE", "BMRKR1", "COUNTRY")), selected = "AGE", multiple = FALSE, fixed = FALSE @@ -211,15 +213,15 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select measurement:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) @@ -236,7 +238,7 @@ app <- teal::init( dataname = "ADSL", select = select_spec( label = "Select variable:", - choices = variable_choices(data@env$ADSL, c("SEX", "AGE", "RACE", "COUNTRY")), + choices = variable_choices(data[["ADSL"]], c("SEX", "AGE", "RACE", "COUNTRY")), selected = NULL, multiple = FALSE, fixed = FALSE @@ -248,7 +250,7 @@ app <- teal::init( x = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("AVAL", "BMRKR1", "BMRKR2")), + choices = variable_choices(data[["ADRS"]], c("AVAL", "BMRKR1", "BMRKR2")), selected = "AVAL", multiple = FALSE, fixed = FALSE, @@ -258,7 +260,7 @@ app <- teal::init( y = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("AVAL", "BMRKR1", "BMRKR2")), + choices = variable_choices(data[["ADRS"]], c("AVAL", "BMRKR1", "BMRKR2")), selected = "BMRKR1", multiple = FALSE, fixed = FALSE, @@ -268,7 +270,7 @@ app <- teal::init( color_by = teal.transform::data_extract_spec( dataname = "ADRS", select = select_spec( - choices = variable_choices(data@env$ADRS, c("AGE", "SEX", "RACE")), + choices = variable_choices(data[["ADRS"]], c("AGE", "SEX", "RACE")), selected = NULL, multiple = FALSE, fixed = FALSE, @@ -283,15 +285,15 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) @@ -308,15 +310,15 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) @@ -333,21 +335,21 @@ app <- teal::init( filter = list( filter_spec( vars = "PARAMCD", - choices = value_choices(data@env$ADLB, "PARAMCD", "PARAM"), - selected = levels(data@env$ADLB$PARAMCD)[1], + choices = value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = levels(data[["ADLB"]]$PARAMCD)[1], multiple = FALSE, label = "Select lab:" ), filter_spec( vars = "AVISIT", - choices = levels(data@env$ADLB$AVISIT), - selected = levels(data@env$ADLB$AVISIT)[1], + choices = levels(data[["ADLB"]]$AVISIT), + selected = levels(data[["ADLB"]]$AVISIT)[1], multiple = FALSE, label = "Select visit:" ) ), select = select_spec( - choices = variable_choices(data@env$ADLB, c("RACE", "SEX")), + choices = variable_choices(data[["ADLB"]], c("RACE", "SEX")), selected = "SEX", multiple = FALSE, fixed = FALSE,