Skip to contents

This 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.

Usage

slices_store(tss, file)

Arguments

tss

(teal_slices) object to be stored.

file

(character(1)) The file path where teal_slices object will be saved. The file extension should be ".json".

Value

NULL, invisibly.

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")
}