tidy_eval | R Documentation |
Evaluate R code by chunks, then insert the output to each chunk. As the output is masked in comments, the source code will not break.
tidy_eval(
source = "clipboard",
...,
file = "",
prefix = "## ",
envir = parent.frame()
)
source |
The input file name (by default the clipboard; see
|
... |
Other arguments passed to |
file |
The file name to write to via |
prefix |
The prefix to mask the output. |
envir |
The environment in which to evaluate the code. By default the
parent frame; set |
Evaluated R code with corresponding output (printed on screen or written to 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.