Learn R Programming

teal (version 0.15.2)

as_tdata: Downgrade teal_data objects in modules for compatibility

Description

Convert teal_data to tdata in teal modules.

Usage

as_tdata(x)

Value

Object of class tdata.

Arguments

x

data object, either tdata or teal_data, the latter possibly in a reactive expression

Details

Recent changes in teal cause modules to fail because modules expect a tdata object to be passed to the data argument but instead they receive a teal_data object, which is additionally wrapped in a reactive expression in the server functions. In order to easily adapt such modules without a proper refactor, use this function to downgrade the data argument.

Examples

Run this code
td <- teal_data()
td <- within(td, iris <- iris) %>% within(mtcars <- mtcars)
td
as_tdata(td)
as_tdata(reactive(td))

Run the code above in your browser using DataLab