proj_library: Attach the files in project's R directory

View source: R/proj_library.R

proj_libraryR Documentation

Attach the files in project's R directory

Description

This will source all *.R files in the R subdirectory of the current project. It loads their contents into a new environment, and attaches that environment at the top of the search path (but underneith the global environment).

Usage

proj_library(dir = NULL, ...)

Arguments

dir

Path of R directory; NULL means use the R directory of the enclosing RStudio project (character)

...

Passed to source

Details

If calls to library() or require() are needed, all such calls must be collected into a special file called "packages.R" (and that file should contain only calls to library() and/or require()). Otherwise, the packages will be loaded into the wrong place on the search list.

Value

Nothing

See Also

proj_source for sourcing project files into the global environment, detach for removing the new environment from the search path.


pteetor/tutils documentation built on April 25, 2024, 9:14 a.m.