sourceDir: sourceDir

Description Usage Arguments Value Note Author(s)

View source: R/systools__sourceDir.R

Description

Sourcing a bunch of files located in different folders/subfolders. Also provide byte-code compiling before sourcing.

Usage

1
2
3
4
5
6
7
8
sourceDir(
  ...,
  byte.compile = FALSE,
  recursive = FALSE,
  envir = .GlobalEnv,
  pattern = "\\.[Rr]$",
  ignore.error = FALSE
)

Arguments

...

"characters"

The inputs can be path to the R code or mixture of paths and files.

byte.compile

"integer".

If byte.compile = 0, the program will only load the R source code.

If byte.compile = 1, the program will first load the byte-compiled file if the byte-compiled file exists and is newer than the R source code, otherwise the program will first byte-compile it and then load the byte-compiled file.

If byte.compile = 2, the program will byte-compile the R source code regardless of the existence of byte-compiled files.

recursive

"logical".

If TRUE, files will be sourced recursively for all sub folders.

envir

"environment".

What is the destiny of the files to be sourced. The default environment is the global environment.

pattern

"string".

What kind of file pattern is sourced.

ignore.error

"logical".

If TRUE, try to continue even errors occur.

Value

"data.frame".

A summary is returned invisibly if input is not empty, otherwise quit with an error.

Note

Initial: Wed Apr 15 20:00:43 CET 2009; Current: Tue Jan 08 23:15:57 CET 2013.

license: GPL(>=2)

TODO: allow parallel souring.

Author(s)

Feng Li, Department of Statistics, Stockholm University, Sweden.


feng-li/flutils documentation built on Oct. 1, 2020, 9:09 p.m.