Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

source.all

R Utilities: Source all R or Rcpp Files within a Directory


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

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

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

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

miceadds

Some Additional Multiple Imputation Functions, Especially for 'mice'

v3.11-6
GPL (>= 2)
Authors
Alexander Robitzsch [aut,cre] (<https://orcid.org/0000-0002-8226-3132>), Simon Grund [aut] (<https://orcid.org/0000-0002-1290-8986>), Thorsten Henke [ctb]
Initial release
2021-01-21 11:48:47

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.