Description Usage Arguments Value Examples
source_file()
will parse through file
looking for functions tagged with
// [[ export() ]]
and will compile the file and export those functions to
the R side.
1 |
file |
The C file to source. |
includes |
Extra includes to add manually. By default, |
no_remap |
Should |
show |
Should the output of compiling the source code with |
A named list containing the functions specified for export.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | tf <- tempfile(fileext = ".c")
code <- "
// [[ export() ]]
SEXP fn(SEXP x) {
return x;
}
"
writeLines(code, tf)
sourced <- source_file(tf)
sourced$fn(1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.