From edd at debian.org  Fri Jun 20 05:32:38 2008
From: edd at debian.org (Dirk Eddelbuettel)
Date: Thu, 19 Jun 2008 22:32:38 -0500
Subject: [Rd] embedding R in c++ (Qt) application
In-Reply-To: <20080619173730.6tdkscsm8ks848o8@webmail.unibas.ch>
References: <20080618141314.bcfilb6nr4wowgw8@webmail.unibas.ch>
	<18521.917.139728.502094@ron.nulle.part>
	<20080619173730.6tdkscsm8ks848o8@webmail.unibas.ch>
Message-ID: <18523.9430.134967.89745@ron.nulle.part>


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
Dirk Eddelbuettel