sourceDir: Sources all files with '.R' or '.r' extensions in a directory

Description Usage Arguments Details Value Author(s)

View source: R/sourceDir.R

Description

Sources all files with '.R' or '.r' extensions in a directory using a try-catch for each file

Usage

1
sourceDir(directory, recursive = FALSE, tryCatch = TRUE, ...)

Arguments

directory

Character string indicating the path of the directory containing the R files to be sourced.

recursive

=TRUE descends into subdirectories of directory

tryCatch

if TRUE, sourcing is protected in a try catch, i.e., if there is an error, sourceDir will continue to the next file. If FALSE, sourceDir will stop if a file sources with an error.

...

Additional arguments to source

Details

In addition to sourcing files for general use, this function is also useful in package development to verify there are no syntax errors prior to building and compilation.

Value

Invisibly returns a character vector containing the files that were identified for sourcing. Also prints a message indicating whether each file was sourced correctly or not.

Author(s)

Landon Sego


pnnl/Smisc documentation built on Oct. 18, 2020, 6:18 p.m.