[R] skeleton for package containing C code?

Thomas Petzoldt thpe at simecol.de
Wed Nov 19 21:15:28 CET 2008


Rainer M Krug wrote:
> Hi
> 
> I looked in the "writing R extensions" and also into package.skeleton,
> but could not find anything:
> 
> I am looking for a skeleton or simple example on how to create a
> package which contains C++ code.
> 
> I only want to implement one function, so nothing complicated. The
> idea is to use the package to make it easier to install the function
> on several Linux computers - no windows required at the moment.
> 
> Thanks,
> 
> Rainer

Hi Rainer,

you can download a minimal R package with C source from here:

http://www.simecol.de/pkg/cpackage_0.1.tar.gz

You can also include C++ files in src/ if you provide plain C interfaces 
as described in "Writing R Extensions".

Hope that helps ...


Thomas P.



More information about the R-help mailing list