Skip to contents

Get code from qenv

Usage

get_code(object, deparse = TRUE)

# S4 method for qenv
get_code(object, deparse = TRUE)

# S4 method for qenv.error
get_code(object)

Arguments

object

(qenv)

deparse

(logical(1)) if the returned code should be converted to character.

Value

named character with the reproducible code.

Examples

q1 <- new_qenv(env = list2env(list(a = 1)), code = quote(a <- 1))
q2 <- eval_code(q1, code = quote(b <- a))
q3 <- eval_code(q2, code = quote(d <- 2))
get_code(q3)
#> [1] "a <- 1" "b <- a" "d <- 2"
get_code(q3, deparse = FALSE)
#> expression(a <- 1, b <- a, d <- 2)