Learn R Programming

DIZutils (version 0.0.13)

global_env_hack: global_env_hack

Description

Hack variable into global env (bypasses R CMD checks). This does create a new variable in the R environment but NOT a new variable in the system environment. To create a system environment variable beeing accessible via `Sys.getenv(...)`, use the function `DIZutils::setenv2(key = "varname", val = 7)`.

Usage

global_env_hack(key, val, pos = 1)

Arguments

key

A character (!) string. The name of the assigned variable

val

An object. The object that will be assigned to 'key'.

pos

An integer. The position of the environment (default: 1).

Value

No return value, called for side effects (see description).

See Also

http://adv-r.had.co.nz/Environments.html

Examples

Run this code
# NOT RUN {
utils_path <- tempdir()
global_env_hack(
  key = "utils_path",
  val = utils_path,
  pos = 1L
)

# }

Run the code above in your browser using DataLab