sourceDir: Source Directory

Description Usage Arguments Details Value Note See Also Examples

View source: R/sourceDir.R

Description

Read all *.R files from a directory containing R functions.

Usage

1
2
sourceDir(dir, pattern = "\\.[r|R]$", all.files = FALSE,
  recursive = FALSE, quiet = TRUE, ...)

Arguments

dir

a directory containing R source files.

pattern

passed to dir when selecting files.

all.files

passed to dir when selecting files.

recursive

passed to dir when selecting files.

quiet

whether to suppress messages.

...

passed to source when sourcing files.

Details

The dir argument can also be a vector of filenames, instead of a directory name. This can be useful to specify certain files while avoiding others.

Value

Names of sourced files.

Note

This function is convenient in TAF analyses when many R utility functions are stored in a directory, see example below.

See Also

source is the base function to read R code from a file.

TAF-package gives an overview of the package.

Examples

1
2
3
4
## Not run: 
sourceDir("bootstrap/software/utilities")

## End(Not run)

TAF documentation built on April 7, 2021, 5:06 p.m.