demo/execute-multiple-commands.R

library(scriptexec)

# execute script text
if (.Platform$OS.type == "windows") {
    ls_command <- "dir"
} else {
    ls_command <- "ls"
}
output <- scriptexec::execute(c("echo user home:", ls_command))
cat(sprintf("Exit Status: %s Output: %s\n", output$status, output$output))

Try the scriptexec package in your browser

Any scripts or data that you put into this service are public.

scriptexec documentation built on May 2, 2019, 1:49 p.m.