datanames: Names of data sets in 'teal_data' object

datanamesR Documentation

Names of data sets in teal_data object

Description

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⁠

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.

Value

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

Examples

td <- teal_data(iris = iris)
td <- within(td, mtcars <- mtcars)
datanames(td)

datanames(td) <- c("iris", "mtcars")
datanames(td)


teal.data documentation built on May 29, 2024, 8:03 a.m.