Skip to content
Prev 284070 / 398506 Next

Compilation of .C into .dll

Hi Scott,

Your question is a FAQ:

http://cran.r-project.org/bin/windows/base/rw-FAQ.html#How-do-I-include-compiled-C-code_003f

also try reading:

http://cran.r-project.org/doc/manuals/R-exts.html#System-and-foreign-language-interfaces

If you want examples, try downloading the source code for some of the
packages on CRAN.  Some of these contain C code which is compiled and
linked.  The first time I did this, it took me quite a few hours
iterating between reading, looking at what others had done, and trying
things out.  To me, that is just the nature of it.  I doubt anyone can
provide a 'very quick script' that will just work for your particular
case.  At that point, it is just an example of what you might do, in
which case just look at existing packages.  Here is one (of many)
packages you could use:

http://cran.r-project.org/web/packages/SoDA/index.html

it is kind of a nice choice, I think, because it accompanies the book,
Software for Data Analysis by John Chambers, so it is sort of geared
towards teaching.

Cheers,

Josh
On Fri, Feb 3, 2012 at 2:24 AM, ScottM <scott.mcgrane at abdn.ac.uk> wrote: