htbFunc: Bulk loader of .R files

View source: R/htbFunc.R

htbFuncR Documentation

Bulk loader of .R files

Description

Sources all the .R files contained in the designamted path(s).

Usage

htbFunc(path = "~/htb/func", recursive = TRUE)

Arguments

path

Strings. The directories where .R files are put.

recursive

A logical. Whether to recursively search for .R files.

Details

Usually your analyses have numbers of functions written in many discrete .R files, possibly contained in different directories. htbFunc() sources all of these .R files existing in the designated path(s) all at once using source(). This will help your coding since you do not need to source() each .R files one by one. You can perform any changes in your codes (maybe within multiple .R files) as needed. When the modifications are done, just call htbFunc() and all the changes are applied by source()ing .R files.

Be careful, however, since .R files are actually executed in the standard way by source(), all of the analysis contents can be immediately started to perform if they are written as scripts. To avoid this, code your analyses as functions in your .R files.

Value

Strings. Names of the functions sourced.

Examples

htbFunc()


keimochizuki/htb documentation built on June 9, 2025, 10:03 p.m.