Skip to contents

Get or set the value of the datanames slot.

Usage

datanames(x)

datanames(x) <- value

Arguments

x

(teal_data) object to access or modify

value

(character) new value for @datanames; all elements must be names of variables existing in @env

Value

The contents of @datanames or teal_data object with updated @datanames.

Details

The @datanames slot in a teal_data object specifies which of the variables stored in its environment (the @env slot) are data sets to be taken into consideration. The contents of @datanames can be specified upon creation and default to all variables in @env. Variables created later, which may well be data sets, are not automatically considered such. Use this function to update the slot.

Examples

td <- teal_data(iris = iris)
td <- within(td, mtcars <- mtcars)
datanames(td)
#> [1] "iris"

datanames(td) <- c("iris", "mtcars")
datanames(td)
#> [1] "iris"   "mtcars"