| Title: | Shared Utilities to Extend the 'teal' Modules |
| Language: | en-US |
| Version: | 0.0.5 |
| Date: | 2026-07-09 |
| URL: | https://github.com/phuse-org/uteals |
| Description: | Provides decorators, transformators, and utility functions to extend the 'teal' framework for interactive data analysis applications. Implements methods for data visualization enhancement, statistical data transformations, and workflow integration tools. Designed to support clinical and pharmaceutical research workflows within the 'teal' ecosystem through modular and reusable components. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| Depends: | R (≥ 4.1.0) |
| Imports: | DT, R6, checkmate, cowplot, dplyr, formatters, ggplot2, ggplotify, gridify, jsonlite, junco, methods, openxlsx, patchwork, rlang, rtables, shiny (≥ 1.11.0), shinyWidgets, shinyjs, teal, teal.code, teal.modules.clinical, teal.reporter, tern, yaml, zip |
| Suggests: | forcats, knitr, rAccess, rmarkdown, teal.data, teal.modules.general, teal.transform |
| VignetteBuilder: | knitr |
| Config/Needs/website: | insightsengineering/nesttemplate |
| Config/roxygen2/version: | 8.0.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-07-09 12:35:48 UTC; kpagacz |
| Author: | Nadia Abraham [aut], Chanchal Bhalla [aut], Peyman Eshghi [aut, cre], Pranith Gourisetty [aut], Sohan Lal [aut], Przemyslaw Posiadala [aut], Alina Tselinina [aut], Konrad Pagacz [aut], PHUSE [cph] |
| Maintainer: | Peyman Eshghi <peymaan.es@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-07-09 13:50:02 UTC |
Decorators and transformators for teal modules.
Description
Provides decorator and transformator modules
for teal modules.
Author(s)
Maintainer: Peyman Eshghi peymaan.es@gmail.com
Authors:
Peyman Eshghi peymaan.es@gmail.com
Nadia Abraham NAbraha5@ITS.JNJ.com
Chanchal Bhalla CBhalla@ITS.JNJ.com
Pranith Gourisetty PGourise@ITS.JNJ.com
Sohan Lal SLal8@ITS.JNJ.com
Przemyslaw Posiadala PPosiada@ITS.JNJ.com
Alina Tselinina ATselini@ITS.JNJ.com
Konrad Pagacz konrad.pagacz@gmail.com
Other contributors:
PHUSE [copyright holder]
See Also
Useful links:
Class BlockConditions
Description
This class represents a collection of conditions used for filtering datasets.
Slots
conditionsA list of conditions, where each condition is a list containing variable, operator, and value.
ReportManager Object
Description
This can be used to manage state of report, load and save them into file
It will create shiny::reactiveVal variables and load report list from report_path
Public fields
reports_path(
character(1))
An absolute path to a folder where reports are storedcurrent_report_title(
character(1))
reactiveValfield that stores current report titleavailable_reports(
list())
reactiveValfield that stores a list of available reportsmy_locked_report(
character(1))
reactiveValfield that stores currently locked report titleread_only_mode(
logical(1))
reactiveValfield that indicates if current report is in read-only modesessionPlaceholder for Shiny session object Initialize
ReportManager
Methods
Public methods
ReportManager$new()
This can be used to manage state of report, load and save them into file
It will create shiny::reactiveVal variables and load report list from reports_path
Usage
ReportManager$new(reports_path, session)
Arguments
reports_path(character) An absolute path to where reports are stored
sessionSession object passed from
moduleServer
Returns
ReportManager object
List available reports from objects' reports_path
ReportManager$list_reports()
Usage
ReportManager$list_reports()
Returns
data.frame with fields reports, created_by, locked_by, and last_rebuild
Method for storing loaded report title inside object.
This assigns a value in current_report_title field
ReportManager$set_current_report_title()
Usage
ReportManager$set_current_report_title(title_or_index)
Arguments
title_or_index(character/numeric) Title of report or an index from objects'
available_reportsGet absolute report path
ReportManager$get_abs_report_path()
Usage
ReportManager$get_abs_report_path(title)
Arguments
title(character) A title of report to get path of
Returns
(character) A path of desired report
Save report with provided title
This utilizes methods from teal.reporter::Reporter to store files required to load and save reports
If a report with specific title exists, it will overwrite it.
ReportManager$save_report_files()
Usage
ReportManager$save_report_files(report_title, reporter, first = FALSE)
Arguments
report_title(
character) A title for the saved report.reporter(
Reporter) A reporter object passed fromteal::initfirst(
logical) Whether this is the first time saving the report.Load report to report previewer This utilizes methods from
teal.reporter::Reporterto load reports
ReportManager$load_report()
Usage
ReportManager$load_report(selected_title, reporter, skip_lock = FALSE)
Arguments
selected_title(
integerorcharacter) An index or a title of a report to loadreporter(
Reporter) A reporter object passed fromteal::initskip_lock(
boolean) Whether to skip locking a report or not Merge reports together
ReportManager$merge_reports()
Usage
ReportManager$merge_reports(x_title, y_title, reporter)
Arguments
x_titleBase report title
y_titleTitle of report to merge into x
reporterA
TealReporterobject Reset report manager
ReportManager$reset()
Usage
ReportManager$reset()
Returns
the return of self$list_reports()
Delete report
ReportManager$delete_report()
Usage
ReportManager$delete_report(selected_title)
Arguments
selected_title(integer or character) An index or a title of a report to load Checks if report is locked by another user
ReportManager$is_locked_by_other()
Usage
ReportManager$is_locked_by_other( report_title, verbose = TRUE, message_type = "error" )
Arguments
report_title(character) A title for the saved report.
verbose(boolean) Whether to show notification on locked report or not
message_type(character)
shiny::showNotification'stype argument
Returns
logical(1) TRUE if locked by another user, FALSE if unlocked or locked by me Rename report
ReportManager$rename_report()
Usage
ReportManager$rename_report(old_title, new_title, reporter)
Arguments
old_title(character) Current report title
new_title(character) New report title
reporter(Reporter) A reporter object Check if this would be a new report
ReportManager$is_new_report()
Usage
ReportManager$is_new_report(reporter)
Arguments
reporter(Reporter) A reporter object
Returns
logical indicating if this is a new report Create new report with title
ReportManager$create_new_report()
Usage
ReportManager$create_new_report(report_title, reporter)
Arguments
report_title(character) Title for the new report
reporter(Reporter) A reporter object Add
observeEventto invoke auto save on reporter cards change.
ReportManager$auto_save_observer()
Usage
ReportManager$auto_save_observer(reporter)
Arguments
reporter(Reporter) A reporter object passed from
teal::initUnlock a locked report
ReportManager$unlock_report_public()
Usage
ReportManager$unlock_report_public(report_title)
Arguments
report_title(character) Title of the report to unlock Release lock on current report (keep report loaded but make it read-only)
ReportManager$release_lock()
Usage
ReportManager$release_lock(report_title = NULL)
Arguments
report_title(character) Title of the report to release lock from Set up CSV download observer
ReportManager$setup_csv_download()
Registers the observeEvent that handles CSV download clicks.
Call once from moduleServer after initialization.
Usage
ReportManager$setup_csv_download(input)
Arguments
inputShiny input object from
moduleServerExport all tables from a saved report as CSV files
ReportManager$export_tables_to_csv()
Loads the report from disk, extracts all table-type content from each card,
converts each to a data.frame and writes it as a CSV file in output_dir.
Returns the vector of written file paths, or an empty character vector when
no tables are found.
Usage
ReportManager$export_tables_to_csv(report_title, output_dir)
Arguments
report_title(character) Title of the report to export.
output_dir(character) Directory where CSV files will be written.
Returns
character vector of written file paths. Re-build reports
ReportManager$rebuild_report()
Rebuild reports to include data that has changed. This will replace loaded report cards with new cards, that were rebuilt from a code used to generate these cards.
Usage
ReportManager$rebuild_report(report_title, rp)
Arguments
report_title(character) A title for the saved report.
rp(Reporter) A reporter object passed from
teal::initGet current user name Get metadata file path Lock report so that it can't be overwritten by another user Unlock report Save creator information Save code from each card ascode.rdsin the report directory. Extract all table-type content from a Reporter as a named list of data.frames RegisteronSessionEndedto unlock report when session is closed
ReportManager$clone()
The objects of this class are cloneable with this method.
Usage
ReportManager$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Add a condition to a BlockConditions object
Description
Add a condition to a BlockConditions object
Usage
add_condition(object, variable, operator, value)
Arguments
object |
A |
variable |
A character string specifying the variable/column name. |
operator |
A character string specifying the operator (e.g., "==", "!=", "<", ">", "<=", ">=", "%in%", "!%in%"). |
value |
The value to compare against. |
Value
An updated BlockConditions object with the new condition added.
Add conditions
Description
Add conditions
Usage
## S4 method for signature 'BlockConditions'
add_condition(object, variable, operator, value)
Create Relative risk column
Description
Usage
create_rel_risk_transformator(dataname, column_name, control_group, label_name)
Arguments
dataname |
( |
column_name |
( |
control_group |
( |
label_name |
( |
Details
This transformator allows the user to select a column and control group from the dataset and create a relative risk column.
Value
teal::teal_transform_module
Examples
app <- teal::init(
data = teal.data::teal_data(IRIS = iris, code = "IRIS <- iris"),
modules = teal::modules(
teal::example_module(
transformators = list(
create_rel_risk_transformator("IRIS",
label_name = "test",
control_group = "setosa", column_name = "Species"
)
)
)
)
)
if (interactive()) {
shiny::shinyApp(app$ui, app$server)
}
Extract Non-Parent Module Labels to YAML
Description
Extracts module labels from a teal modules object, filters out parent modules
(grouping containers), and generates a
YAML file with the functional modules.
Usage
extract_modules_to_yaml(mods, filepath, verbose = FALSE)
Arguments
mods |
( |
filepath |
( |
verbose |
( |
Value
Character vector of non-parent module labels
Examples
# Extract modules from mods object to YAML file
mods <- teal::modules(
teal::example_module("mod1"),
teal::example_module("mod2")
)
labels <- extract_modules_to_yaml(mods, "panel_str_modules.yml")
unlink("panel_str_modules.yml")
# Clean up
if (file.exists("panel_str_modules.yml")) {
file.remove("panel_str_modules.yml")
}
View model for or_filtering_transformator().
Description
View model for or_filtering_transformator().
Public fields
block_objectsBlock objects.
r_valsReactive values.
alt_idThe id of the last alternative.
block_conditionsConditions as strings.
choices_for_columnsChoices for the columns.
final_filter_exprFinal filtering expression.
final_expFinal expression for
teal.data. Initializes the object
Methods
Public methods
filtering_transformator_model$new()
Usage
filtering_transformator_model$new(data, dataname)
Arguments
datathe reactive data object from
teal.datanamecharacter(1)the name of the dataset. Adds an alternative
filtering_transformator_model$add_alternative()
Usage
filtering_transformator_model$add_alternative()
Returns
invisibly self. Checks for duplicate conditions
filtering_transformator_model$is_duplicate_condition()
Usage
filtering_transformator_model$is_duplicate_condition(cond_str, block_cond_list)
Arguments
cond_strcharacter(1)added condition.block_cond_listcharacter(1)list of all conditions.
Returns
logical(1) whether the added condition is a duplicate.
filtering_transformator_model$clone()
The objects of this class are cloneable with this method.
Usage
filtering_transformator_model$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Change X-axis scaling decorator for teal.modules.clinical::tm_g_forest_rsp.
Description
A function to create a UI component for selecting a transform function
for the forest plot x axis.
Usage
forestplot_x_decorator()
Details
The module creates a UI with a radio control for selecting the transform function. The selected transformation function is applied to the forest plot to update the plot's axis and annotations accordingly.
Value
teal::teal_transform_module Returns a modified plot object with the transformation applied.
Examples
library(teal.modules.clinical)
data <- teal.data::teal_data()
data <- within(data, {
ADSL <- teal.modules.clinical::tmc_ex_adsl
ADRS <- teal.modules.clinical::tmc_ex_adrs |>
dplyr::mutate(AVALC = tern::d_onco_rsp_label(AVALC) |>
formatters::with_label("Character Result/Finding")) |>
dplyr::filter(PARAMCD != "OVRINV" | AVISIT == "FOLLOW UP")
})
teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[names(data)]
ADSL <- data[["ADSL"]]
ADRS <- data[["ADRS"]]
arm_ref_comp <- list(
ARM = list(
ref = "B: Placebo",
comp = c("A: Drug X", "C: Combination")
),
ARMCD = list(
ref = "ARM B",
comp = c("ARM A", "ARM C")
)
)
app <- teal::init(
data = data,
modules = teal::modules(
teal.modules.clinical::tm_g_forest_rsp(
label = "Forest Response",
dataname = "ADRS",
arm_var = choices_selected(
variable_choices(ADSL, c("ARM", "ARMCD")),
"ARMCD"
),
arm_ref_comp = arm_ref_comp,
paramcd = choices_selected(
value_choices(ADRS, "PARAMCD", "PARAM"),
"INVET"
),
subgroup_var = choices_selected(
variable_choices(ADSL, names(ADSL)),
c("BMRKR2", "SEX")
),
strata_var = choices_selected(
variable_choices(ADSL, c("STRATA1", "STRATA2")),
"STRATA2"
),
plot_height = c(600L, 200L, 2000L),
decorators = list(
plot = forestplot_x_decorator()
),
default_responses = list(
BESRSPI = list(
rsp = c("Stable Disease (SD)", "Not Evaluable (NE)"),
levels = c(
"Complete Response (CR)", "Partial Response (PR)", "Stable Disease (SD)",
"Progressive Disease (PD)", "Not Evaluable (NE)"
)
),
INVET = list(
rsp = c("Complete Response (CR)", "Partial Response (PR)"),
levels = c(
"Complete Response (CR)", "Not Evaluable (NE)", "Partial Response (PR)",
"Progressive Disease (PD)", "Stable Disease (SD)"
)
),
OVRINV = list(
rsp = c("Progressive Disease (PD)", "Stable Disease (SD)"),
levels = c("Progressive Disease (PD)", "Stable Disease (SD)", "Not Evaluable (NE)")
)
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
Create a forest plot from an rtable with x transform settings
Description
Given a
rtables::rtable() object with at least one column with a single value and one column with 2
values, converts table to a ggplot2::ggplot() object and generates an accompanying forest plot. The
table and forest plot are printed side-by-side.
Usage
g_forest_with_transform(
tbl,
col_x = attr(tbl, "col_x"),
col_ci = attr(tbl, "col_ci"),
vline = 1,
forest_header = attr(tbl, "forest_header"),
xlim = c(0.1, 10),
transform_x = NA,
x_at = c(0.1, 1, 10),
width_columns = NULL,
lbl_col_padding = 0,
rel_width_forest = 0.25,
font_size = 12,
col_symbol_size = attr(tbl, "col_symbol_size"),
col = getOption("ggplot2.discrete.colour")[1],
ggtheme = NULL,
as_list = FALSE
)
Arguments
tbl |
( |
col_x |
( |
col_ci |
( |
vline |
( |
forest_header |
( |
xlim |
( |
transform_x |
( |
x_at |
( |
width_columns |
( |
lbl_col_padding |
( |
rel_width_forest |
( |
font_size |
( |
col_symbol_size |
( |
col |
( |
ggtheme |
( |
as_list |
( |
Value
ggplot forest plot and table.
Get condition expression
Description
Get condition expression
Usage
get_str_expression(object, dataname, data)
Arguments
object |
A |
dataname |
|
data |
The reactive |
Value
character(1) The condition expression.
Get condition expression
Description
Get condition expression
Usage
## S4 method for signature 'BlockConditions'
get_str_expression(object, dataname, data)
ggplot decorator
Description
Decorator function to update various settings for
ggplot plot objects
Usage
ggplot_decorator(
output_name,
label_text = "decorator",
render_ui = c(),
plot_options = list(title = "", footnote = "", y_breaks = "", y_limits_max = "",
y_limits_min = "", x_breaks = "", x_labels_discrete = "", x_labels_cont = "",
y_labels_discrete = "", y_labels_cont = "", font_size_geom_text = "",
font_size_plot_title = "", font_size_axis_title = "", font_size_axis_text = "")
)
Arguments
output_name |
a name for the output plot object. |
label_text |
customized label text for the decorator |
render_ui |
vector of |
plot_options |
named list with the list of values for the |
Details
The module creates a UI with text controls for specifying the list
of ggplot options given in the plot_options parameter value.
The entered ggplot options are applied to ggplot plot object.
Value
teal::teal_transform_module Returns a modified plot object with the transformation applied.
Examples
data <- teal.data::teal_data()
data <- within(data, {
ADSL <- teal.data::rADSL
})
teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[names(data)]
# teal.modules.general >= 0.6.0
app <- teal::init(
data = data,
modules = teal::modules(
teal.modules.general::tm_g_scatterplot(
label = "Scatterplot Choices",
x = teal.transform::data_extract_spec(
dataname = "ADSL",
select = teal.transform::select_spec(
label = "Select variable:",
choices = teal.transform::variable_choices(data[["ADSL"]], c("AGE", "BMRKR1", "BMRKR2")),
selected = "AGE",
multiple = FALSE,
fixed = FALSE
)
),
y = teal.transform::data_extract_spec(
dataname = "ADSL",
select = teal.transform::select_spec(
label = "Select variable:",
choices = teal.transform::variable_choices(data[["ADSL"]], c("AGE", "BMRKR1", "BMRKR2")),
selected = "BMRKR1",
multiple = FALSE,
fixed = FALSE
)
),
decorators = list(
plot = ggplot_decorator(
output_name = "plot", render_ui = c("title", "footnote", "font_size_axis_title")
)
)
)
)
)
if (interactive()) {
shiny::shinyApp(app$ui, app$server)
}
Filter Teal Modules by Label
Description
Recursively filters a teal modules object to keep only modules whose labels
match the specified labels. Removes modules that don't match and empty
parent containers.
Usage
keep_by_label(x, label)
Arguments
x |
( |
label |
( |
Value
Filtered teal_modules or teal_module object, or NULL if none matches.
Examples
# Keep only specific modules by label
mods <- teal::modules(
teal::example_module("mod1"),
teal::example_module("mod2")
)
filtered_mods <- keep_by_label(mods, c("Data Table", "Disposition"))
Combine levels of a variable into one level
Description
Usage
merge_levels_transformator(dataname, predefined = list())
Arguments
dataname |
( |
predefined |
( |
Details
This transformator allows the user to select a column from the dataset and merge levels of this column into a new level. Only selected levels are affected.
Value
teal::teal_transform_module
Examples
app <- teal::init(
data = teal.data::teal_data(IRIS = iris, code = "IRIS <- iris"),
modules = teal::modules(
teal::example_module(
transformators = list(merge_levels_transformator(
dataname = "IRIS",
predefined = list(
list("Species", "setosa", "SETOSA_WITHIN_FIX"),
list("Petal.Width", c(0.2, 0.3, 0.5), 12)
)
))
)
)
)
if (interactive()) {
shiny::shinyApp(app$ui, app$server)
}
Apply Logical AND/OR filter transformations
Description
This transformator provides users with flexible, dynamic filtering capabilities for datasets.
Each instance of the transformator operates on a single dataset. Users can define multiple filter blocks, where:
Conditions within each block are combined with logical AND.
Multiple blocks are combined with logical OR.
This allows creating complex filter expressions like:
(Condition1 AND Condition2) OR (Condition3 AND Condition4)
To apply filtering across multiple datasets, users can instantiate multiple instances of this module, each configured for a different dataset. Each module call is independent and manages filters for its specific dataset.
-
Supported Data Types & Expressions:
Supports filtering on
character,factor, andnumericcolumns.Conditions can use operators:
==,!=,<,>,<=,>=,%in%,!%in%.Conditions are specified as simple expressions, e.g.,
columnA == 'value'columnB != 5columnC >= 10Each block's conditions are combined with AND.
Multiple blocks are combined with OR.
-
Features:
-
Add Multiple OR Blocks: Dynamically add new blocks for alternative conditions.
-
Add Conditions: Within each block, add multiple conditions, with duplicate prevention.
-
Preview Filter Expression: Generate and display the current combined filter expression.
-
Remove Conditions: Remove individual conditions within a block.
-
Expression Generation: The resulting expression can be directly used with
dplyr::filter()or similar functions.
-
-
Usage Pattern:
Call the module multiple times with different dataset names to filter multiple datasets independently.
Each call manages its own filter state and expression.
Users can build complex filters per dataset and apply or combine them as needed.
Usage
or_filtering_transformator(dataname)
Arguments
dataname |
( |
Value
teal::teal_transform_module
Examples
app <- teal::init(
data = teal.data::teal_data(IRIS = iris),
modules = teal::modules(teal::example_module(
transformators = list(or_filtering_transformator("IRIS"))
))
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
Patchwork Decorator
Description
Decorator function to add plot title and footnote to patchwork plots
Usage
patchwork_plot_decorator(output_name, label_text = "decorator")
Arguments
output_name |
( |
label_text |
( |
Details
The module creates a UI with text controls for plot title and footnote. The entered title and footnote text are applied to the patchwork plots.
Value
(teal.data::qenv) Returns a modified plot object with the transformation applied.
Remove Teal Modules by Label
Description
Recursively removes modules from a teal modules structure that match the specified labels.
Usage
remove_by_label(x, label)
Arguments
x |
( |
label |
( |
Value
The filtered teal modules object with matching modules removed, or NULL
if all modules are removed.
Examples
mods <- teal::modules(
teal::example_module("mod1"),
teal::example_module("mod2")
)
# Remove a single module
filtered_mods <- remove_by_label(mods, "Deaths")
# Remove multiple modules
filtered_mods <- remove_by_label(mods, c("Deaths", "Lab Summary Table"))
The server part of tm_report_manager().
Description
The server part of tm_report_manager().
Usage
report_manager_server(id, reports_path = "reports", auto_save = TRUE, reporter)
Arguments
id |
( |
reports_path |
character. Absolute path where reports should be stored. |
auto_save |
logical. Whether to save active report whenever there are any changes made. |
reporter |
the object that holds the report. Provided by |
The UI of tm_report_manager()
Description
The UI of tm_report_manager()
Usage
report_manager_ui(id)
Arguments
id |
( |
Title and Footer Decorator
Description
A function to create a UI component for selecting a title and footer
for tables or plots. It reads title information from a specified Excel
file and allows users to choose a title from the provided options.
It also provides user with flexibility to customize the title and footer
according to their specific needs.
Usage
title_footer_decorator(
output_name,
titles_file,
choices = NULL,
selected = NULL
)
Arguments
output_name |
( |
titles_file |
( |
choices |
( |
selected |
( |
Details
The module creates a UI with a dropdown for selecting a title. Once a title is selected, it updates the output by either adding titles to a table or modifying a plot's title and caption accordingly. Additionally, it includes a checkbox that user can check to enable customization, allowing them to enter their own values for the title and footer in the designated input fields.
Value
See Also
For the exact Excel workbook layout expected by this function, see the package vignette:
vignette("title-footer-decorator-excel-structure", package = "uteals")
Examples
library(openxlsx)
library(teal.modules.general)
example_excel <- data.frame(
`TABLE ID` = c(
"DO_NOT_DELETE",
"TSFAE01A", "TSFAE01A", "TSFAE01A",
"TSFAE01B", "TSFAE01B"
),
IDENTIFIER = c(
"DO_NOT_DELETE",
"TITLE", "FOOTNOTE1", "FOOTNOTE2",
"TITLE", "FOOTNOTE1"
),
TEXT = c(
"DO_NOT_DELETE",
"Adverse Events Summary A", "Source: Clinical Study Report", "Confidential",
"Adverse Events Summary B", "Draft Version"
),
stringsAsFactors = FALSE,
check.names = FALSE
)
temp_titles <- tempfile(fileext = ".xlsx")
write.xlsx(example_excel, temp_titles, sheetName = "Sheet1", asTable = TRUE)
plot_module <- tm_g_scatterplot(
label = "Scatter Plot",
x = data_extract_spec(
dataname = "IRIS",
select = select_spec(
choices = variable_choices(
"IRIS", c("Sepal.Length", "Sepal.Width")
), selected = "Sepal.Length"
)
),
y = data_extract_spec(
dataname = "IRIS",
select = select_spec(
choices = variable_choices(
"IRIS", c("Petal.Length", "Petal.Width")
), selected = "Petal.Length"
)
),
decorators = list(
plot = title_footer_decorator(
"plot", temp_titles,
choices = c("TSFAE01A", "TSFAE01B"), selected = NULL
)
)
)
# Initialize the teal app
app <- init(
data = teal_data(IRIS = iris),
modules = list(plot_module)
)
# Run the app
if (interactive()) {
shinyApp(app$ui, app$server)
}
Report Manager Module
Description
Report Manager Module
Usage
tm_report_manager(reports_path = "reports", auto_save = TRUE)
Arguments
reports_path |
character. Absolute path where reports should be stored. |
auto_save |
logical. Whether to save active report whenever there are any changes made. |
Details
This module supports collaborative work on teal reports, generated by teal.reporter
package. This module extends functionalities of teal.reporter and allows to store
reports in chosen path. Reports will be stored as JSON files inside folders named after
reports.
Examples
app <- teal::init(
data = teal.data::teal_data(IRIS = iris),
modules = teal::modules(
teal::example_module(transformators = list(or_filtering_transformator("IRIS"))),
tm_report_manager()
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
Watermark Decorator
Description
A function to create a UI component for selecting watermark text
for plots.
Note: Currently tables are not supported
Usage
watermark_decorator(output_name, watermark_text = "", font_size = 90)
Arguments
output_name |
( |
watermark_text |
( |
font_size |
( |
Details
The module creates a UI with textInput for specifying watermark text and
font size.
the entered watermark text is displayed with a default gridify layout.