Learn R Programming

expss (version 0.10.7)

default_dataset: Get or set reference to default dataset. Experimental feature.

Description

Use data.frame or data.frame name to set it as default. Use NULL as an argument to disable default dataset. If argument is missing then function will return reference to default dataset. Use ref to modify it. Also see .compute for usage patterns.

Usage

default_dataset(x)

Arguments

x

data.frame or data.frame name which we want to make default for some operations.

Value

formula reference to default dataset or NULL

See Also

ref

Examples

Run this code
# NOT RUN {
data(iris)
default_iris = iris
default_dataset(default_iris) # set default dataset

.compute({
    new_col = 1
    Sepal.Length = Sepal.Length*2 
})

# for comparison

iris$new_col = 1
iris$Sepal.Length = iris$Sepal.Length*2 
identical(iris, default_iris) # should be TRUE

default_dataset(NULL) # disable default dataset

# }

Run the code above in your browser using DataLab