capture_expr | R Documentation |
Evaluate expression and captures output as characters, then concatenate as one single string.
capture_expr(expr, collapse = "\n", type = c("output", "message"), ...)
expr |
R expression |
collapse |
character to concatenate outputs |
type , ... |
passed to |
Character of length 1: output captured by
capture.output
x <- data.frame(a=1:10)
x_str <- capture_expr({
print(x)
})
x_str
cat(x_str)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.