tidy_eval {formatR} | R Documentation |
This function is designed to insert the output of each chunk of R code into the source code without really breaking the source code, since the output is masked in comments.
tidy_eval(source = "clipboard", ..., file = "", prefix = "## ", envir = parent.frame())
source |
the input filename (by default the clipboard; see
|
... |
other arguments passed to |
file |
the file to write by |
prefix |
the prefix to mask the output |
envir |
the environment in which to evaluate the code (by default the
parent environment; if we do not want to mess up with the parent
environment, we can set |
Evaluated R code with corresponding output (printed on screen or written in a file).
library(formatR) ## evaluate simple code as a character vector tidy_eval(text = c("a<-1+1;a", "matrix(rnorm(10),5)")) ## evaluate a file tidy_eval(system.file("format", "messy.R", package = "formatR"))