diff --git a/R/teal_data_module-within.R b/R/teal_data_module-within.R index e81bfa1058..0d478f768c 100644 --- a/R/teal_data_module-within.R +++ b/R/teal_data_module-within.R @@ -15,9 +15,9 @@ #' @examples #' within(tdm, dataset1 <- subset(dataset1, Species == "virginica")) #' -#' # in an app, use input-derived value in the expression -#' within(tdm, dataset1 <- subset(dataset1, Species == species), species = input$species) -#' +#' # use additional parameter for expression value substitution. +#' valid_species = "versicolor" +#' within(tdm, dataset1 <- subset(dataset1, Species %in% species), species = valid_species) #' @include teal_data_module.R #' @name within #' @rdname teal_data_module diff --git a/man/teal_data_module.Rd b/man/teal_data_module.Rd index 5c404d64ae..83878890cf 100644 --- a/man/teal_data_module.Rd +++ b/man/teal_data_module.Rd @@ -93,9 +93,9 @@ eval_code(tdm, "dataset1 <- subset(dataset1, Species == 'virginica')") within(tdm, dataset1 <- subset(dataset1, Species == "virginica")) -# in an app, use input-derived value in the expression -within(tdm, dataset1 <- subset(dataset1, Species == species), species = input$species) - +# use additional parameter for expression value substitution. +valid_species = "versicolor" +within(tdm, dataset1 <- subset(dataset1, Species \%in\% species), species = valid_species) } \seealso{ \code{\linkS4class{teal_data}}, \code{\link[teal.code:qenv]{teal.code::qenv()}}