Skip to contents

Get object from the qenv environment.

Usage

get_var(object, var)

# S4 method for qenv,character
get_var(object, var)

# S4 method for qenv.error,ANY
get_var(object, var)

# S4 method for qenv,ANY,missing
[[(x, i, j, ...)

# S3 method for qenv.error
[[(x, i, j, ...)

Arguments

object

(qenv)

var

(character(1)) name of the variable to pull from the environment.

x

(qenv)

i

(character) name of the binding in environment (name of the variable)

j

not used

...

not used

Value

The value of required variable (var) within qenv object.

Examples

q1 <- new_qenv(env = list2env(list(a = 1)), code = quote(a <- 1))
q2 <- eval_code(q1, code = "b <- a")
get_var(q2, "b")
#> [1] 1
q2[["b"]]
#> [1] 1