source.all: R Utilities: Source all R or 'Rcpp' Files within a Directory

Description Usage Arguments Details Examples

View source: R/source.all.R

Description

The 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.

Usage

1
2
3
4
5
6
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() )

Arguments

path

Path where the files are located

grepstring

Which strings should be looked for? grepstring can also be a vector.

print.source

An optional logical whether the source process printed on the console?

file_sep

String at which file name should be splt 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

Details

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".

Examples

1
2
3
4
5
6
## Not run: 
# define path
path <- "c:/myfiles/"
# source all files containing the string 'Rex'
source.all( path, "Rex" )
## End(Not run)

alexanderrobitzsch/miceadds documentation built on Aug. 16, 2018, 5:29 a.m.