run_all_files() sources all R scripts matching a glob pattern inside a
subdirectory of the project's R/ folder. The target subdirectory is derived
from the type argument using the same convention as create_file():
"figure" maps to R/figures/, "table" maps to R/tables/,
"data" maps to R/data/, "analysis" maps to R/analysis/, and any
other value maps to R/<type>s/.
For type values "figure" or "table", the function additionally checks
for discrepancies between the files in the directory and the table of tables
(ToT) before sourcing, and issues a warning if any are found.
run_all_figures() and run_all_tables() are convenient wrappers around
run_all_files().
Arguments
- type
Character. The type of scripts to run. Controls the subdirectory of
R/that is searched:"figure"->R/figures/"table"->R/tables/"data"->R/data/"analysis"->R/analysis/any other value ->
R/<type>s/
- glob
Character. A glob pattern passed to
fs::dir_ls()to include or exclude files.Default:
"*.R"– matches all R scripts (case-sensitive).- quiet
Logical. If
TRUE, suppress informational messages.Default:
FALSEunless the global optionlbstproj.quietis set otherwise. The default can be changed viaoptions(lbstproj.quiet = TRUE).
