sourceDirectory
From R.utils v1.5.8
by Henrik Bengtsson
Sources files recursively to either local or global environment
Sources files recursively to either local or global environment.
- Keywords
- programming, IO
Usage
## S3 method for class 'default':
sourceDirectory(path, pattern=".*[.](r|R|s|S|q)([.](lnk|LNK))*$", recursive=TRUE, envir=parent.frame(), onError=c("error", "warning", "skip"), verbose=FALSE, ...)
Arguments
- path
- A path to a directory to be sourced.
- pattern
- A regular expression file name pattern to identify source code files.
- recursive
- If
TRUE
, subdirectories are recursively sourced first, otherwise not. - envir
- An
environment
in which the code should be evaluated. - onError
- If an error occures, the error may stop the job, give a warning, or silently be skipped.
- verbose
- A
logical
or aVerbose
object. - ...
- Additional arguments passed to
sourceTo
().
Value
- Returns a
vector
of the full pathnames of the files sourced.
Details
Subdirectories and files in each (sub-)directory are sourced in lexicographic order.
Hooks
This method does not provide hooks, but the internally used
sourceTo
() does.
See Also
Community examples
Looks like there are no examples yet.