by native R operators/functions:
x[[name]]
, x$name
or get()
.
Retrieve variables from the qenv
environment.
Usage
get_var(object, var)
# S3 method for class 'qenv.error'
x[[i]]
Arguments
- object, x
(qenv
)
- var, i
(character(1)
) variable name.
Value
The value of required variable (var
) within qenv
object.
Examples
q <- qenv()
q1 <- eval_code(q, code = quote(a <- 1))
q2 <- eval_code(q1, code = "b <- a")
get_var(q2, "b")
#> Warning: `get_var()` was deprecated in teal.code 0.5.1.
#> ℹ Please use `base::get()` instead.
#> [1] 1