An R6 class to manage data loading, preprocessing, and common UI elements for various Shiny modules in the package. It handles file reading (csv, xlsx, sav, sas7bdat, dta), initial variable analysis, and the rendering and logic for common data manipulations like creating binary variables, changing factor references, and subsetting data. This class is designed to be used internally by other Shiny server modules to reduce code duplication.
input
Shiny module's input object.
output
Shiny module's output object.
session
Shiny module's session object.
ns
Shiny module's namespace function.
nfactor.limit
The threshold for unique values to suggest a numeric variable as a factor.
initial_data_info
A reactive value holding the initially loaded data and its metadata.
processed_data
A reactive value holding the data after all transformations have been applied.
new()
Create a new DataManager object.
DataManager$new(input, output, session, nfactor.limit = 20)
input
Shiny module's input object.
output
Shiny module's output object.
session
Shiny module's session object.
nfactor.limit
The maximum number of unique values for a continuous variable to be suggested as a factor.
A new `DataManager` object.
get_reactive_data()
Returns the final processed data as a reactive expression. This is the main output to be used by the calling module.
DataManager$get_reactive_data()
A reactive expression that returns a list containing the processed `data`, `label` information, and `naomit` message.
clone()
The objects of this class are cloneable with this method.
DataManager$clone(deep = FALSE)
deep
Whether to make a deep clone.