View source: R/RcppEigen.package.skeleton.R
RcppEigen.package.skeleton | R Documentation |
RcppEigen.package.skeleton
automates the creation of
a new source package that intends to use features of RcppEigen.
It is based on the package.skeleton function which it executes first.
RcppEigen.package.skeleton(name = "anRpackage", list = character(),
environment = .GlobalEnv, path = ".", force = FALSE,
code_files = character(), example_code = TRUE)
name |
See package.skeleton |
list |
See package.skeleton |
environment |
See package.skeleton |
path |
See package.skeleton |
force |
See package.skeleton |
code_files |
See package.skeleton |
example_code |
If TRUE, example C++ code using RcppEigen is added to the package |
In addition to package.skeleton :
The ‘DESCRIPTION’ file gains a Depends line requesting that the package depends on Rcpp and RcppEigen and a LinkingTo line so that the package finds Rcpp and RcppEigen header files.
The ‘NAMESPACE’ gains a useDynLib
directive.
The ‘src’ directory is created if it does not exists and a ‘Makevars’ file is added setting the environment variable ‘PKG_LIBS’ to accomodate the necessary flags to link with the Rcpp library.
If the example_code
argument is set to TRUE
,
example files ‘rcppeigen_hello_world.h’ and ‘rcppeigen_hello_world.cpp’
are also created in the ‘src’. An R file ‘rcppeigen_hello_world.R’ is
expanded in the ‘R’ directory, the rcppeigen_hello_world
function
defined in this files makes use of the C++ function ‘rcppeigen_hello_world’
defined in the C++ file. These files are given as an example and should
eventually by removed from the generated package.
Nothing, used for its side effects
Read the Writing R Extensions manual for more details.
Once you have created a source package you need to install it:
see the R Installation and Administration manual,
INSTALL
and install.packages
.
package.skeleton
## Not run:
RcppEigen.package.skeleton("foobar")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.