sink_all | R Documentation |
All output and messages up to the first error, for example thrown by
stop
.
sink_all(path, code)
path |
The path of the file to divert to. |
code |
The code to be executed. |
Invisibly
NULL
.
sink_path <- file.path(tempdir(), "sink_all.txt")
sink_all(sink_path, {
print("some output")
warning("a warning")
message("a message")
print("some more output")
})
cat(readLines(sink_path), sep = "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.