Store teal_slices object to a file
slices_store.RdThis function takes a teal_slices object and saves it to a file in JSON format.
The teal_slices object contains information about filter states and can be used to
create, modify, and delete filter states. The saved file can be later loaded using
the slices_restore function.
Arguments
- tss
(
teal_slices) object to be stored.- file
(
character(1)) The file path whereteal_slicesobject will be saved. The file extension should be".json".
Examples
# Create a teal_slices object
tss <- teal_slices(
teal_slice(dataname = "data", varname = "var"),
teal_slice(dataname = "data", expr = "x > 0", id = "positive_x", title = "Positive x")
)
if (interactive()) {
# Store the teal_slices object to a file
slices_store(tss, "path/to/file.json")
}