runLocalScript: runLocalScript returns a tidy output for a file that was run

Description Usage Arguments Value

View source: R/runLocalScript.R

Description

This function returns a tibble with all of the information available from running the file. Specifically it helps capture the standard error/output by dumping to a temporary file and reading it back in. It's also possible to specify the std_out and std_error files if desired.

Usage

1
2
3
4
5
6
7
runLocalScript(
  x,
  args = "--vanilla",
  std_err = NULL,
  std_out = NULL,
  error_on_missing = FALSE
)

Arguments

x

a path to a file to run

args

command line arguments for R

std_err

either NULL (writes to temp file) or values allowed by r_wait

std_out

either NULL (writes to temp file) or values allowed by r_wait

error_on_missing

if FALSE then the function catches errors and returns a reasonable tibble otherwise an error is thrown.

Value

a tibble with the following columns: status - the exit status of the script std_error - the output of std_error std_out - the output of std_out time_taken - the amount of time it took to run the function


West-End-Statistics/r-library-vakdr documentation built on Dec. 18, 2021, 7:16 p.m.