From Peter.Peyk at unibas.ch  Fri Jun 20 08:36:52 2008
From: Peter.Peyk at unibas.ch (Peter.Peyk at unibas.ch)
Date: Fri, 20 Jun 2008 08:36:52 +0200
Subject: [Rd] embedding R in c++ (Qt) application
In-Reply-To: <18523.9430.134967.89745@ron.nulle.part>
References: <20080618141314.bcfilb6nr4wowgw8@webmail.unibas.ch>
	<18521.917.139728.502094@ron.nulle.part>
	<20080619173730.6tdkscsm8ks848o8@webmail.unibas.ch>
	<18523.9430.134967.89745@ron.nulle.part>
Message-ID: <20080620083652.pl7hgeykz4skcss0@webmail.unibas.ch>

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.
>



[Rd] embedding R in c++ (Qt) application
Peter.Peyk at unibas.ch