-
-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
Description
What happened?
Example to reproduce:
devtools::load_all()
data <- teal_data(join_keys = default_cdisc_join_keys[c("ADSL", "ADRS")])
data <- within(data, {
require(nestcolor)
ADSL <- rADSL
ADRS <- rADRS
})
# For tm_outliers
fact_vars_adsl <- names(Filter(isTRUE, sapply(data[["ADSL"]], is.factor)))
vars <- choices_selected(variable_choices(data[["ADSL"]], fact_vars_adsl))
caption_decorator <- function(default_caption = "I am a good decorator", .var_to_replace = "plot") {
print(.var_to_replace)
teal_transform_module(
label = "Caption",
ui = function(id) shiny::textInput(shiny::NS(id, "footnote"), "Footnote", value = default_caption),
server = make_teal_transform_server(
substitute(
{
.var_to_replace <- .var_to_replace + ggplot2::labs(caption = footnote)
},
env = list(.var_to_replace = as.name(.var_to_replace))
)
)
)
}
init(
data = data,
modules = modules(
tm_a_pca(
"PCA",
dat = data_extract_spec(
dataname = "ADSL",
select = select_spec(
choices = variable_choices(data = data[["ADSL"]], c("BMRKR1", "AGE", "EOSDY")),
selected = c("BMRKR1", "AGE")
)
),
decorators = list(
eigenvector_plot = caption_decorator("I am a eigenvector_plot", "eigenvector_plot")
)
)
)
) |> shiny::runApp()Code of Conduct
- I agree to follow this project's Code of Conduct.
Contribution Guidelines
- I agree to follow this project's Contribution Guidelines.
Security Policy
- I agree to follow this project's Security Policy.