Skip to content

Commit e1ac439

Browse files
removing pacakge:: call from example and fixing example.
1 parent eedf61f commit e1ac439

29 files changed

+653
-605
lines changed

R/choices_labeled.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@
2121
#'
2222
#' @examples
2323
#' library(shiny)
24+
#' library(teal.data)
2425
#'
2526
#' ADSL <- rADSL
2627
#' ADTTE <- rADTTE
2728
#'
28-
#' choices1 <- choices_labeled(names(ADSL), teal.data::col_labels(ADSL, fill = FALSE))
29+
#' choices1 <- choices_labeled(names(ADSL), col_labels(ADSL, fill = FALSE))
2930
#' choices2 <- choices_labeled(ADTTE$PARAMCD, ADTTE$PARAM)
3031
#'
3132
#' # if only a subset of variables are needed, use subset argument
3233
#' choices3 <- choices_labeled(
3334
#' names(ADSL),
34-
#' teal.data::col_labels(ADSL, fill = FALSE),
35+
#' col_labels(ADSL, fill = FALSE),
3536
#' subset = c("ARMCD", "ARM")
3637
#' )
3738
#'
@@ -52,9 +53,10 @@
5253
#' selected = choices3[1]
5354
#' )
5455
#' )
56+
#' server <- function(input, output) {}
5557
#'
5658
#' if (interactive()) {
57-
#' shinyApp(ui = ui, server = function(input, output) {})
59+
#' shinyApp(ui, server)
5860
#' }
5961
#' @export
6062
#'
@@ -144,14 +146,16 @@ choices_labeled <- function(choices, labels, subset = NULL, types = NULL) {
144146
#' @return Named `character` vector with additional attributes or `delayed_data` object.
145147
#'
146148
#' @examples
149+
#' library(teal.data)
150+
#'
147151
#' ADRS <- rADRS
148152
#' variable_choices(ADRS)
149153
#' variable_choices(ADRS, subset = c("PARAM", "PARAMCD"))
150154
#' variable_choices(ADRS, subset = c("", "PARAM", "PARAMCD"))
151155
#' variable_choices(
152156
#' ADRS,
153157
#' subset = c("", "PARAM", "PARAMCD"),
154-
#' key = teal.data::default_cdisc_join_keys["ADRS", "ADRS"]
158+
#' key = default_cdisc_join_keys["ADRS", "ADRS"]
155159
#' )
156160
#'
157161
#' # delayed version

R/choices_selected.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ no_select_keyword <- "-- no selection --"
3939
#'
4040
#' @examples
4141
#' library(shiny)
42+
#' library(teal.widgets)
4243
#'
4344
#' # all_choices example - semantically the same objects
4445
#' choices_selected(choices = letters, selected = all_choices())
4546
#' choices_selected(choices = letters, selected = letters)
4647
#'
4748
#' choices_selected(
48-
#' choices = stats::setNames(LETTERS[1:5], paste("Letter", LETTERS[1:5])),
49+
#' choices = setNames(LETTERS[1:5], paste("Letter", LETTERS[1:5])),
4950
#' selected = "C"
5051
#' )
5152
#'
@@ -112,14 +113,16 @@ no_select_keyword <- "-- no selection --"
112113
#' )
113114
#'
114115
#' ui <- fluidPage(
115-
#' teal.widgets::optionalSelectInput(
116+
#' optionalSelectInput(
116117
#' inputId = "id",
117118
#' choices = cs$choices,
118119
#' selected = cs$selected
119120
#' )
120121
#' )
122+
#'
123+
#' server <- function(input, output, session) {}
121124
#' if (interactive()) {
122-
#' shinyApp(ui, server = function(input, output, session) {})
125+
#' shinyApp(ui, server)
123126
#' }
124127
#' @export
125128
#'

R/data_extract_filter_module.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,14 @@ data_extract_filter_srv <- function(id, datasets, filter) {
142142
#' @return named `list` with two slots `choices` and `selected`.
143143
#'
144144
#' @examples
145+
#' library(shiny)
145146
#' # use non-exported function from teal.transform
146147
#' get_initial_filter_values <- getFromNamespace("get_initial_filter_values", "teal.transform")
147148
#'
148-
#' filtered_data_list <- list(iris = shiny::reactive(utils::head(iris)))
149+
#' filtered_data_list <- list(iris = reactive(head(iris)))
149150
#' filter <- filter_spec(vars = colnames(iris)[1])
150151
#' filter$dataname <- "iris"
151-
#' shiny::isolate(
152+
#' isolate(
152153
#' get_initial_filter_values(filter = filter, datasets = filtered_data_list)
153154
#' )
154155
#'

0 commit comments

Comments
 (0)