cppXPtr | R Documentation |
XPtr
with a C++ ImplementationDynamically define an XPtr
with C++ source code. Compiles and links a shared
library with bindings to the C++ function using cppFunction
,
then returns an XPtr
that points to the function and can be used to be
plugged into another C++ backend.
cppXPtr( code, depends = character(), plugins = character(), includes = character(), rebuild = FALSE, cacheDir = getOption("rcpp.cache.dir", tempdir()), showOutput = verbose, verbose = getOption("verbose") )
code |
Source code for the function definition. |
depends |
Character vector of packages that the compilation depends on. Each package listed will first be queried for an inline plugin to determine header files to include. If no plugin is defined for the package then a header file based the package's name (e.g. |
plugins |
Character vector of inline plugins to use for the compilation. |
includes |
Character vector of user includes (inserted after the includes provided by |
rebuild |
Force a rebuild of the shared library. |
cacheDir |
Directory to use for caching shared libraries. If the underlying code passed to |
showOutput |
|
verbose |
|
An object of class XPtr
that points to the compiled function.
cppFunction
, checkXPtr
# takes time to compile ptr <- cppXPtr("double foo(int a, double b) { return a + b; }") class(ptr) print(ptr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.