Learn R Programming

teal.data (version 0.5.0)

datanames: Names of data sets in teal_data object

Description

Get or set the value of the datanames slot.

Usage

datanames(x)

datanames(x) <- value

Value

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

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.

Examples

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

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

Run the code above in your browser using DataLab