[Rd] Accesing R c-code

From: Patricia Bautista Otero <bautista_at_cimat.mx>
Date: Thu 28 Sep 2006 - 17:36:24 GMT

Hi r-devel,

I am working on a R extension. My package is writen on C++ and in my code I require a R function object. I received the R function object, then a point x in which the "function" is going to be evaluated is generated in some way, then I evalue the "function" at x and I repete this process several thousand of times. Since I am using the function eval(SEXP fn, SEXP env) my code is really slow. Due to my major concern is speed, I wonder to know when it is posible to access to the parse tree of the R function object and build my own c++ parser tree in order to have c++ doing the evaluations of the function instead of R, as it is now working in my c++ code. What I want to avoid is to have to develope a complete parser mainly because it would take me too much time since I am a newe in compilers and parsers.

It would also help me to know how R mcmc packages work, because it is more or less the same situation. In mcmc packages a target density function is required, and I suppose this density function is evaluated many many times, but this packages are not too slow.

Then, if anyone is able to provide me any insight into what I might to, I would be grateful.


R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Sep 29 03:38:13 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 28 Sep 2006 - 18:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.