Combine levels of a variable into one level
Source:R/merge_levels_transformator.R
merge_levels_transformator.RdDetails
This transformator allows the user to select a column from the dataset and combine values of this column into a single level. Only selected levels are affected.
The new combined level is called "Combined".
Merging works only for character or factor columns.
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("IRIS"))
)
)
)
if (interactive()) {
shiny::shinyApp(app$ui, app$server)
}