| parse_output | R Documentation |
This function processes the result of a run() call by parsing
the specified output stream ("stdout", "stderr", or "both") into
individual, trimmed lines.
parse_output(res, stream = c("stdout", "stderr", "both", "plain"))
res |
A list containing the result of |
stream |
A character string specifying the data stream to parse.
Must be either |
A character vector where each element is a trimmed line from the specified stream.
# Example result object from condathis::run()
res <- list(
stdout = "line1\nline2\nline3\n",
stderr = "error1\nerror2\n"
)
# Parse the standard output
parse_output(res, stream = "stdout")
# Parse the standard error
parse_output(res, stream = "stderr")
# Merge both
parse_output(res, stream = "both")
# # Parse plain text
plain_text <- "This is line one.\nThis is line two.\nThis is line three."
parse_output(plain_text, stream = "plain")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.