R Utilities: Source all R or Rcpp Files within a Directory — source.all" />
source.all.RdThe function source.all sources all R files within a specified directory and
is based on base::source.
The function source.Rcpp.all sources all Rcpp files within a specified directory
and is based on Rcpp::sourceCpp.
The function rcpp_create_header_file creates a cpp header file for a Rcpp
file.
source.all( path, grepstring="\\.R", print.source=TRUE, file_sep="__" ) source.Rcpp.all( path, file_names=NULL, ext="\\.cpp", excl="RcppExports", remove_temp_file=FALSE ) rcpp_create_header_file(file_name, pack=NULL, path=getwd() )
| path | Path where the files are located |
|---|---|
| grepstring | Which strings should be looked for?
|
| print.source | An optional logical whether the source process printed on the console? |
| file_sep | String at which file name should be split for looking for most recent files |
| file_names | Optional vector of (parts of) file names |
| ext | File extension for Rcpp files |
| excl | String indicating which files should be omitted from sourcing |
| remove_temp_file | Logical indicating whether temporary Rcpp files should be removed. |
| file_name | File name |
| pack | Optional string for package |
For loading header files, the line // [include_header_file] has to be included
before loading the header file using a line of the form
#include "my_function.h".
if (FALSE) { # define path path <- "c:/myfiles/" # source all files containing the string 'Rex' source.all( path, "Rex" ) }