Skip to content

C++ interface?

3 messages · Fredrik Karlsson, Brian Ripley, Jun Yan

#
Dear list,

I would like to write a R package that interfaces with existing C++
classes (which I did not write myself). After having read the relevant
part of `Writing R Extensions', I have to say that the issue is still
somewhat of a mistery to me. One obvious explanation for this is that I
have not had any practical experience in C++, only C, meaning that I am
relying on what I've read a long time ago.

However, I think I'll manage if I could find example code more extensive
than the one in the `Writing R Extensions' manual. Does anyone know
of any package that are using the C++ <-> R interface that where I can
get inspiration?

What I would need is example code of class instantiation, calling of
object method as well as passing values/objects from/to C++ within R.

Greateful for all the help I can get!

/Fredrik
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
The following CRAN packages (at least) use C++ sources

GeneSOM, Matrix, RandomFields, Suppdists, e1071, geepack, rgenoud

I would start by looking at Matrix, which also has an article in the
DSC2001 proceedings.
On Fri, 15 Nov 2002, Fredrik Karlsson wrote:

            

  
    
#
You might also look at src/inter.cc in package geepack. geepack uses TNT
(Template Numerical Toolkit, http://math.nist.gov/tnt/). Several interface 
functions are defined in inter.cc to covert an R object into a C++ object,
and to convert a C++ object to R object.


Jun
On Fri, 15 Nov 2002 ripley at stats.ox.ac.uk wrote:

            
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._