source.dir: Source Directory

View source: R/source.dir.R

source.dirR Documentation

Source Directory

Description

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

Usage

source.dir(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

## Not run: 
source.dir("boot/software/utilities")

## End(Not run)


TAF documentation built on March 31, 2023, 6:51 p.m.