Skip to contents

Given code is evaluated in the qenv environment and appended to the code slot. This means that state of the environment is always a result of the stored code (if qenv was initialized) with reproducible code.

Usage

eval_code(object, code)

# S4 method for qenv,expression
eval_code(object, code)

# S4 method for qenv,language
eval_code(object, code)

# S4 method for qenv,character
eval_code(object, code)

# S4 method for qenv.error,ANY
eval_code(object, code)

Arguments

object

(qenv)

code

(character or language) code to evaluate. Also accepts and stores comments

Examples

q1 <- new_qenv(env = list2env(list(a = 1)), code = quote(a <- 1))
q2 <- eval_code(q1, quote(library(checkmate)))
q3 <- eval_code(q2, quote(assert_number(a)))