[R] Interfacing R and C++

2009-11-10 Thread Nathan Harmston
Hi, I m currently working on interfacing R and C++ (passing a matrix from R to C++, doing some stuff, returning a vector of results). There seem to be a number of ways of doing this, such as rcpp and swig. Is there a recommended way of doing this? In the long run I would like what I m working on t

Re: [R] Calling C code from R...wrapping C structures

2008-05-14 Thread Nathan Harmston
> is explained in: > > > http://cran.r-project.org/doc/manuals/R-exts.html#Interface-functions-_002eC-and-_002eFortran > > which also provides some examples. If you want to pass a list, you'll > probably have to use .Call, not .C. > > HTH, > > R. > > > &

[R] Calling C code from R...wrapping C structures

2008-05-13 Thread Nathan Harmston
Hi everyone, I am currently trying to call some C code from R, specifically calling a function which populates a C struct. typedef struct{ // contents } Model; void test(Model *m){ // fill the struct with crap } I compile the C code into a shared library, which loads into R properly. My s