sourceC               package:R.native               R Documentation

Compiles and loads C source code

Description:

     Compiles and loads C source code.

Usage:

     ## Default S3 method:
     sourceC(filename, ...)

Arguments:

filename: The filename of the library to compile.

     ...: Arguments passed to 'compile()' of the 'NativeCode' class.

Value:

     Returns nothing.

Author(s):

     Henrik Bengtsson (<URL: http://www.braju.com/R/>)

Examples:

     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")

