Usage
eval_cmd(cmd, out_paths, overwrite = FALSE, print = FALSE)
Arguments
- cmd
string expression to evaluate
- out_paths
vector or list of output paths
- overwrite
flag to overwrite output paths (default: FALSE)
- print
flag to print command only (default: FALSE)
Value
Invisibly returns NULL; evaluates cmd for its side effects.
Examples
out_path <- file.path(tempdir(), "eval-cmd-example.txt")
eval_cmd(
"writeLines('hello', out_path)",
out_paths = out_path,
overwrite = TRUE
)
#>
#> [CMD] writeLines('hello', out_path)
#> Error in eval(parse(text = cmd), envir = .GlobalEnv): object 'out_path' not found