Re: [Rd] Accesing R c-code

From: Sean Davis <>
Date: Thu 28 Sep 2006 - 18:13:56 GMT

On Thursday 28 September 2006 13:36, Patricia Bautista Otero wrote:
> 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.

If you want to look at a package, you can just download the source and look at it. The source for most packages is available on CRAN.

Sean mailing list Received on Fri Sep 29 04:21:20 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 - 20:30:50 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.