
Last chance! 50% off unlimited learning
Sale ends in
Scan the source files within a package for attributes and generate code as required. Generates the bindings required to call C++ functions from R for functions adorned with the Rcpp::export
attribute.
compileAttributes(pkgdir = ".", verbose = getOption("verbose"))
Returns (invisibly) a character vector with the paths to any files that were updated as a result of the call.
Directory containing the package to compile attributes for (defaults to the current working directory).
TRUE
to print detailed information about generated code to the console.
The source files in the package directory given by pkgdir
are scanned for attributes and code is generated as required based on the attributes.
For C++ functions adorned with the Rcpp::export
attribute, the C++ and R source code required to bind to the function from R is generated and added (respectively) to src/RcppExports.cpp
or R/RcppExports.R
. Both of these files are automatically generated from scratch each time compiledAttributes
is run.
In order to access the declarations for custom Rcpp::as
and Rcpp::wrap
handlers the compileAttributes
function will also call any inline plugins available for packages listed in the LinkingTo
field of the DESCRIPTION
file.
Rcpp::export
, Rcpp::interfaces
if (FALSE) {
# Compile attributes for package in the current working dir
compileAttributes()
}
Run the code above in your browser using DataLab