datapackager_object_read: Read an object created in a previously run processing script.

Description Usage Arguments Details Value Examples

View source: R/environments.R

Description

Read an object created in a previously run processing script.

Usage

1

Arguments

name

character the name of the object. Must be a name available in the configuration objects. Other objects are not saved.

Details

This function is only accessible within an R or Rmd file processed by DataPackageR. It searches for an environment named ENVS within the current environment, that holds the object with the given name. Such an environment is constructed and populated with objects specified in the yaml objects property and passed along to subsequent R and Rmd files as DataPackageR processes them in order.

Value

An R object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
if(rmarkdown::pandoc_available()){
ENVS <- new.env() # ENVS would be in the environment
                 # where the data processing is run. It is
                 # handled automatically by the package.
assign("find_me", 100, ENVS) #This is done automatically by DataPackageR

find_me <- datapackager_object_read("find_me") # This would appear in an Rmd processed by
                                    # DataPackageR to access the object named "find_me" created
                                    # by a previous script. "find_me" would also need to
                                    # appear in the objects property of config.yml
}

RGLab/DataPackageR documentation built on Nov. 12, 2018, 10:51 p.m.