[R] passing lists through .C

Catherine Loader catherine at research.bell-labs.com
Wed Dec 12 04:26:04 CET 2001

I have a list,

> rb
[1] "tree"
[1] 0
[1] 0.8
 [1] 0 0
and pass it through .C("fn",rb) to

void fn(ev)
int **ev;
{ double cut;
  cut = *(double *)ev[2][0];

in S-4, it produces 0.8, as I want.
But R (version 1.3.1, linux) produces a segmentation fault.
Is it possible to access list elements in R? The manual seems
to suggest writing .Call interfaces, which I want to avoid.

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

More information about the R-help mailing list