Learn R Programming

OpasnetUtils (version 1.3)

Fetch: Fetch R objects described in a data.frame

Description

Download a batch of R objects from Opasnet servers.

Usage

Fetch(dependencies, evaluate = FALSE, indent = 0, verbose = TRUE, ...)
Fetch2(...)

Arguments

dependencies

data.frame which defines variable names and "locations"

evaluate

TRUE to run EvalOutput on each variable (non-ovariables are ignored)

indent

integer internal argument for verbose printing

verbose

use TRUE to enable status messages in between fetches

excess arguments are ignored or passed to EvalOutput if evaluate is TRUE

Value

No return value. Fetched variables are written in .GlobalEnv.

Details

The input data.frame should have columns "Name" and at least one of "Key" and "Ident".

Key is the R-tools session identifier (shown at the end of the url). Ident should be in format <page_id>/<code_name>.

Fetch first checks if the variable (or something with the same name) is already available, if it is nothing will be done. If Key is defined (not NA or "") for a variable it takes precedence over Ident.

Fetch is run as first part of ComputeDependencies.

See also: http://en.opasnet.org/

Examples

Run this code
deps <- data.frame(Name = "exposure", Key = "6WYTFxiZUIxiY8tw")

Fetch(deps)
exposure


# If variable exists
exposure <- 1
Fetch(deps)
exposure # by default existing variables are not changed

Run the code above in your browser using DataLab