[Rd] embedding R in c++ (Qt) application

Peter.Peyk at unibas.ch Peter.Peyk at unibas.ch
Fri Jun 20 08:36:52 CEST 2008


Hi Dirk,

ok - now it works. All the MACROs scared me a little,
but now I've found them in Rinternals.h and Rdefines.h .
There was a section in the official manual referring to these,
but this section was not introduced for embedded R but for calling c++  
from R - this is why i didn't find it at first.

Thanks again for you help!!
Best
Peter

>
> Peter,
>
> On 19 June 2008 at 17:37, Peter.Peyk at unibas.ch wrote:
> | Hi Dirk,
> |
> | I've had a closer look now at Rcpp and I've found a lot
> | of constructors and functions that take SEXPs as input - so the   
> way back from
> | R to C++ seems clear to me.
> |
> | However, I don't know how to pass my data from c++ to R . I've managed
> | to have the embedded R evaluate commands (construct vectors and do
> | something with them) with the help of the official manual,
> | but I couldn't assign for instance an RcppVector to an SEXP or any of
> | these constructed vectors ...
>
> I think you are halfway there. You have an embedded R session, you can assign
> variables and evaluate commands. You also see RCpp and how to pass data
> out. I think all I did at that point was to invert a few of those functions
> to pass data in ... and there you have it in your embedded R session.
>
> Hope this helps, Dirk
>
> --
> Three out of two people have difficulties with fractions.
>



More information about the R-devel mailing list