Evaluates code in a special context in which all output is captured,
similar to capture.output().
capture_output(code, print = FALSE, width = 80) capture_output_lines(code, print = FALSE, width = 80)
| code | Code to evaluate. |
|---|---|
If |
|
| width | Number of characters per line of output. This does not
inherit from |
capture_output() returns a single string. capture_output_lines()
returns a character vector with one entry for each line
#> [1] "Hi!\nBye"#> [1] "Hi!" "Bye"capture_output("Hi")#> [1] ""capture_output("Hi", print = TRUE)#> [1] "[1] \"Hi\""