include: Source R files

Description Usage Arguments Details Value

View source: R/include.R

Description

Source R files

Usage

1
2
3
4
5
6
include(
  files_andor_dirs,
  envir = parent.frame(),
  chdir = FALSE,
  recursive = FALSE
)

Arguments

files_andor_dirs

A character vector of filepaths to R files, or directories containing R files. Directories are searched for files that end with extension ".R" or ".r", ignoring those that start with a period (.) or an underscore (_). The found files files from each directory are sorted by their basename() before being sourced. Filepaths can be supplied explicitly to override the default sorting.

envir

An R environment. By default, the current R evaluation environment.

chdir

logical; if TRUE, the R working directory is changed to the directory containing file for evaluating.

recursive

whether to search directories recursively for R files.

Details

This is a vectorized wrapper around base::sys.source with some differences. Notably:

Value

The environment envir, invisibly.


envir documentation built on Nov. 26, 2020, 9:06 a.m.