sourceC               package:R.native               R Documentation

_C_o_m_p_i_l_e_s _a_n_d _l_o_a_d_s _C _s_o_u_r_c_e _c_o_d_e

_D_e_s_c_r_i_p_t_i_o_n:

     Compiles and loads C source code.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

filename: The filename of the library to compile.

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

_V_a_l_u_e:

     Returns nothing.

_A_u_t_h_o_r(_s):

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

_E_x_a_m_p_l_e_s:

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

