Skip to contents

Subsets qenv environment and limits the code to the necessary needed to build limited objects.

Usage

# S3 method for class 'qenv'
x[names, ...]

Arguments

x

(qenv)

names

(character) names of objects included in qenv to subset. Names not present in qenv are skipped.

...

internal usage, please ignore.

Examples

q <- qenv()
q <- eval_code(q, "a <- 1;b<-2")
q["a"]
#> <environment: 0x5577d2e3e968> 🔒 
#> Parent: <environment: package:checkmate> 
#> Bindings:
#> - a: [numeric]
q[c("a", "b")]
#> <environment: 0x5577d34541f8> 🔒 
#> Parent: <environment: package:checkmate> 
#> Bindings:
#> - a: [numeric]
#> - b: [numeric]