tdata: Create a 'tdata' object

tdataR Documentation

Create a tdata object

Description

[Deprecated]

Create a new object called tdata which contains data, a reactive list of data.frames (or MultiAssayExperiment), with attributes:

  • code (reactive) containing code used to generate the data

  • join_keys (join_keys) containing the relationships between the data

  • metadata (named list) containing any metadata associated with the data frames

Usage

new_tdata(data, code = "", join_keys = NULL, metadata = NULL)

Arguments

data

(named list) A list of data.frame or MultiAssayExperiment objects, which optionally can be reactive. Inside this object all of these items will be made reactive.

code

(character or reactive which evaluates to a character) containing the code used to generate the data. This should be reactive if the code is changing during a reactive context (e.g. if filtering changes the code). Inside this object code will be made reactive

join_keys

(teal.data::join_keys) object containing relationships between the datasets.

metadata

(named list) each element contains a list of metadata about the named data.frame Each element of these list should be atomic and length one.

Value

A tdata object.

See Also

as_tdata

Examples


data <- new_tdata(
  data = list(iris = iris, mtcars = reactive(mtcars), dd = data.frame(x = 1:10)),
  code = "iris <- iris
    mtcars <- mtcars
    dd <- data.frame(x = 1:10)",
  metadata = list(dd = list(author = "NEST"), iris = list(version = 1))
)

# Extract a data.frame
isolate(data[["iris"]]())

# Get code
isolate(get_code_tdata(data))

# Get metadata
get_metadata(data, "iris")


teal documentation built on May 29, 2024, 10:11 a.m.