Skip to contents

[Deprecated] Chunks are being deprecated qenv objects should be used instead

Format

An R6Class generator object

Fields

comment

(character) comment_to_show

Methods

initialize(comment = NULL)

Create the object by setting the field comment

get_rcode(envir = parent.frame()

For the code chunk with the string of the R-Code is returned.

get_eval_info()

Returns a list of information about evaluation.

Examples

x <- chunk_comment$new(comment = "I want a comment in this line")

x$eval()
#> NULL
x$get_rcode()
#> [1] "# I want a comment in this line"
safe_comment <- x$get_rcode()

x <- chunk_comment$new(comment = "# I want a comment in this line")
x$eval()
#> NULL
x$get_rcode()
#> [1] "# I want a comment in this line"
stopifnot(x$get_rcode() == safe_comment)