Description Usage Arguments Value Examples
source_function()
is the most basic way to source a C function to the R
side. It sources a single C function and exports it on the R side. There
is no need to include the // [[ export() ]]
tag when
using source_function()
, since only one function will be exported.
1 | source_function(x, includes = NULL, no_remap = TRUE, show = FALSE)
|
x |
A block of code containing a single C function to compile. |
includes |
Extra includes to add manually. By default, |
no_remap |
Should |
show |
Should the output of compiling the source code with |
An R function that calls the compiled C code.
1 2 3 4 5 6 7 8 9 | code <- "
SEXP fn(SEXP x) {
return x;
}
"
fn <- source_function(code)
fn(1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.