| sourceC {R.native} | R Documentation |
Compiles and loads C source code.
## Default S3 method: sourceC(filename, ...)
filename |
The filename of the library to compile. |
... |
Arguments passed to compile() of the
NativeCode class. |
Returns nothing.
Henrik Bengtsson (http://www.braju.com/R/)
filename <- "hello.c";
if (!isFile(filename)) {
path <- system.file("code", package="R.native");
file.copy(file.path(path, filename), filename);
}
# Compile the source code
sourceC(filename);
# Call the function
.C("hello")