Skip to content

Commit

Permalink
chore: getting the data object using [[ instead of accessing the env …
Browse files Browse the repository at this point in the history
…slot + fix lints
  • Loading branch information
vedhav committed Nov 7, 2023
1 parent d09651f commit d8a889e
Show file tree
Hide file tree
Showing 30 changed files with 294 additions and 273 deletions.
2 changes: 1 addition & 1 deletion R/tm_a_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#' ),
Expand Down
2 changes: 1 addition & 1 deletion R/tm_a_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions R/tm_g_association.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#' )
Expand All @@ -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
Expand All @@ -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
#' )
Expand All @@ -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
#' )
Expand Down
4 changes: 2 additions & 2 deletions R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions R/tm_g_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions R/tm_g_scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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,
Expand All @@ -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",
Expand All @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions R/tm_g_scatterplotmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions R/tm_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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
#' )
#' )
Expand Down
6 changes: 3 additions & 3 deletions R/tm_t_crosstable.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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])
#' }),
Expand All @@ -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])
#' }),
Expand Down
2 changes: 1 addition & 1 deletion man/tm_a_pca.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tm_a_regression.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/tm_g_association.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/tm_g_bivariate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/tm_g_distribution.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/tm_g_response.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d8a889e

Please sign in to comment.