| tm_outliers | R Documentation |
teal module: Outliers analysisModule to analyze and identify outliers using different methods such as IQR, Z-score, and Percentiles, and offers visualizations including box plots, density plots, and cumulative distribution plots to help interpret the outliers.
tm_outliers(
label = "Outliers Module",
outlier_var = teal.picks::picks(teal.picks::datasets(),
teal.picks::variables(is.numeric, 1L, multiple = FALSE)),
categorical_var = teal.picks::picks(teal.picks::datasets(),
teal.picks::variables(choices = teal.picks::is_categorical(min.len = 1, max.len =
10), selected = 1L, multiple = TRUE)),
ggtheme = c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void"),
ggplot2_args = teal.widgets::ggplot2_args(),
plot_height = c(600, 200, 2000),
plot_width = NULL,
pre_output = NULL,
post_output = NULL,
transformators = list(),
decorators = list()
)
Object of class teal_module to be used in teal applications.
This module generates the following objects, which can be modified in place using decorators:
box_plot (ggplot)
density_plot (ggplot)
cumulative_plot (ggplot)
A Decorator is applied to the specific output using a named list of teal_transform_module objects.
The name of this list corresponds to the name of the output to which the decorator is applied.
See code snippet below:
tm_outliers(
..., # arguments for module
decorators = list(
box_plot = teal_transform_module(...), # applied only to `box_plot` output
density_plot = teal_transform_module(...), # applied only to `density_plot` output
cumulative_plot = teal_transform_module(...) # applied only to `cumulative_plot` output
)
)
For additional details and examples of decorators, refer to the vignette
vignette("decorate-module-output", package = "teal.modules.general").
To learn more please refer to the vignette
vignette("transform-module-output", package = "teal") or the teal::teal_transform_module() documentation.
This module returns an object of class teal_module, that contains a server function.
Since the server function returns a teal_report object, this makes this module reportable, which means that
the reporting functionality will be turned on automatically by the teal framework.
For more information on reporting in teal, see the vignettes:
vignette("reportable-shiny-application", package = "teal.reporter")
vignette("adding-support-for-reporting-to-custom-modules", package = "teal")
# general data example
data <- teal_data()
data <- within(data, CO2 <- CO2)
app <- init(
data = data,
modules = modules(
tm_outliers(
outlier_var = teal.picks::picks(
datasets("CO2", "CO2"),
teal.picks::variables(c("conc", "uptake"), "uptake"),
teal.picks::values()
),
categorical_var = teal.picks::picks(
datasets("CO2", "CO2"),
teal.picks::variables(c("Plant", "Type", "Treatment"), "Plant"),
teal.picks::values()
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
# CDISC data example
data <- teal_data()
data <- within(data, {
ADSL <- teal.data::rADSL
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
app <- init(
data = data,
modules = modules(
tm_outliers(
outlier_var = teal.picks::picks(
datasets("ADSL", "ADSL"),
teal.picks::variables(c("AGE", "BMRKR1"), "AGE")
),
categorical_var = teal.picks::picks(
datasets("ADSL", "ADSL"),
teal.picks::variables(teal.picks::is_categorical(min.len = 1, max.len = 10))
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.