|
54 | 54 | #' When function is provided object names don't need to match module's internal naming. For example |
55 | 55 | #' `function(x) x <- x + ggtitle("Custom Title")`. |
56 | 56 | #' |
| 57 | +#' @examplesShinylive |
| 58 | +#' library(teal.modules.general) |
| 59 | +#' interactive <- function() TRUE |
| 60 | +#' {{ next_example }} |
57 | 61 | #' @examples |
58 | 62 | #' # general data example |
59 | | -#' library(teal.widgets) |
60 | | -#' |
61 | 63 | #' data <- teal_data() |
62 | 64 | #' data <- within(data, { |
63 | 65 | #' require(nestcolor) |
64 | 66 | #' CO2 <- CO2 |
65 | 67 | #' }) |
66 | | -#' datanames(data) <- c("CO2") |
67 | 68 | #' |
68 | 69 | #' app <- init( |
69 | 70 | #' data = data, |
|
89 | 90 | #' multiple = TRUE, |
90 | 91 | #' fixed = FALSE |
91 | 92 | #' ) |
92 | | -#' ), |
93 | | -#' ggplot2_args = ggplot2_args( |
94 | | -#' labs = list(subtitle = "Plot generated by Regression Module") |
95 | 93 | #' ) |
96 | 94 | #' ) |
97 | 95 | #' ) |
|
100 | 98 | #' shinyApp(app$ui, app$server) |
101 | 99 | #' } |
102 | 100 | #' |
| 101 | +#' @examplesShinylive |
| 102 | +#' library(teal.modules.general) |
| 103 | +#' interactive <- function() TRUE |
| 104 | +#' {{ next_example }} |
| 105 | +#' @examples |
103 | 106 | #' # CDISC data example |
104 | | -#' library(teal.widgets) |
105 | | -#' |
106 | 107 | #' data <- teal_data() |
107 | 108 | #' data <- within(data, { |
108 | 109 | #' require(nestcolor) |
109 | 110 | #' ADSL <- rADSL |
110 | 111 | #' }) |
111 | | -#' datanames(data) <- "ADSL" |
112 | | -#' join_keys(data) <- default_cdisc_join_keys[datanames(data)] |
| 112 | +#' join_keys(data) <- default_cdisc_join_keys[names(data)] |
113 | 113 | #' |
114 | 114 | #' app <- init( |
115 | 115 | #' data = data, |
|
135 | 135 | #' multiple = TRUE, |
136 | 136 | #' fixed = FALSE |
137 | 137 | #' ) |
138 | | -#' ), |
139 | | -#' ggplot2_args = ggplot2_args( |
140 | | -#' labs = list(subtitle = "Plot generated by Regression Module") |
141 | 138 | #' ) |
142 | 139 | #' ) |
143 | 140 | #' ) |
@@ -298,37 +295,37 @@ ui_a_regression <- function(id, decorators, ...) { |
298 | 295 | conditionalPanel( |
299 | 296 | condition = "input.plot_type == 'Response vs Regressor'", |
300 | 297 | ns = ns, |
301 | | - ui_teal_transform_module(ns("d_0"), transforms = decorators[[1]]) |
| 298 | + ui_transform_data(ns("d_0"), transforms = decorators[[1]]) |
302 | 299 | ), |
303 | 300 | conditionalPanel( |
304 | 301 | condition = "input.plot_type == 'Residuals vs Fitted'", |
305 | 302 | ns = ns, |
306 | | - ui_teal_transform_module(ns("d_1"), transforms = decorators[[1]]) |
| 303 | + ui_transform_data(ns("d_1"), transforms = decorators[[1]]) |
307 | 304 | ), |
308 | 305 | conditionalPanel( |
309 | 306 | condition = "input.plot_type == 'Normal Q-Q'", |
310 | 307 | ns = ns, |
311 | | - ui_teal_transform_module(ns("d_2"), transforms = decorators[[1]]) |
| 308 | + ui_transform_data(ns("d_2"), transforms = decorators[[1]]) |
312 | 309 | ), |
313 | 310 | conditionalPanel( |
314 | 311 | condition = "input.plot_type == 'Scale-Location'", |
315 | 312 | ns = ns, |
316 | | - ui_teal_transform_module(ns("d_3"), transforms = decorators[[1]]) |
| 313 | + ui_transform_data(ns("d_3"), transforms = decorators[[1]]) |
317 | 314 | ), |
318 | 315 | conditionalPanel( |
319 | 316 | condition = "input.plot_type == 'Cook\\'s distance'", |
320 | 317 | ns = ns, |
321 | | - ui_teal_transform_module(ns("d_4"), transforms = decorators[[1]]) |
| 318 | + ui_transform_data(ns("d_4"), transforms = decorators[[1]]) |
322 | 319 | ), |
323 | 320 | conditionalPanel( |
324 | 321 | condition = "input.plot_type == 'Residuals vs Leverage'", |
325 | 322 | ns = ns, |
326 | | - ui_teal_transform_module(ns("d_5"), transforms = decorators[[1]]) |
| 323 | + ui_transform_data(ns("d_5"), transforms = decorators[[1]]) |
327 | 324 | ), |
328 | 325 | conditionalPanel( |
329 | 326 | condition = "input.plot_type == 'Cook\\'s dist vs Leverage'", |
330 | 327 | ns = ns, |
331 | | - ui_teal_transform_module(ns("d_6"), transforms = decorators[[1]]) |
| 328 | + ui_transform_data(ns("d_6"), transforms = decorators[[1]]) |
332 | 329 | ), |
333 | 330 | ), |
334 | 331 | checkboxInput(ns("show_outlier"), label = "Display outlier labels", value = TRUE), |
@@ -1006,13 +1003,13 @@ srv_a_regression <- function(id, |
1006 | 1003 | ) |
1007 | 1004 | }) |
1008 | 1005 |
|
1009 | | - decorated_output_0 <- srv_teal_transform_module(id = "d_0", data = output_plot_0, transforms = decorators[[1]]) |
1010 | | - decorated_output_1 <- srv_teal_transform_module(id = "d_1", data = output_plot_1, transforms = decorators[[1]]) |
1011 | | - decorated_output_2 <- srv_teal_transform_module(id = "d_2", data = output_plot_2, transforms = decorators[[1]]) |
1012 | | - decorated_output_3 <- srv_teal_transform_module(id = "d_3", data = output_plot_3, transforms = decorators[[1]]) |
1013 | | - decorated_output_4 <- srv_teal_transform_module(id = "d_4", data = output_plot_4, transforms = decorators[[1]]) |
1014 | | - decorated_output_5 <- srv_teal_transform_module(id = "d_5", data = output_plot_5, transforms = decorators[[1]]) |
1015 | | - decorated_output_6 <- srv_teal_transform_module(id = "d_6", data = output_plot_6, transforms = decorators[[1]]) |
| 1006 | + decorated_output_0 <- srv_transform_data(id = "d_0", data = output_plot_0, transforms = decorators[[1]]) |
| 1007 | + decorated_output_1 <- srv_transform_data(id = "d_1", data = output_plot_1, transforms = decorators[[1]]) |
| 1008 | + decorated_output_2 <- srv_transform_data(id = "d_2", data = output_plot_2, transforms = decorators[[1]]) |
| 1009 | + decorated_output_3 <- srv_transform_data(id = "d_3", data = output_plot_3, transforms = decorators[[1]]) |
| 1010 | + decorated_output_4 <- srv_transform_data(id = "d_4", data = output_plot_4, transforms = decorators[[1]]) |
| 1011 | + decorated_output_5 <- srv_transform_data(id = "d_5", data = output_plot_5, transforms = decorators[[1]]) |
| 1012 | + decorated_output_6 <- srv_transform_data(id = "d_6", data = output_plot_6, transforms = decorators[[1]]) |
1016 | 1013 |
|
1017 | 1014 |
|
1018 | 1015 | output_q <- reactive({ |
|
0 commit comments