[Rcpp-devel] R Embedded in a class function

Davor Cubranic cubranic at stat.ubc.ca
Fri Mar 18 01:21:23 CET 2011


On 2011-03-17, at 3:31 PM, Dirk Eddelbuettel wrote:

> | And it so happens that I just wrote an example of instantiating RInside and
> | passing to Qt so that you'd get 'R inside Qt'.  That is now in SVN for
> | RInside but I haven't even gotten around to writing a short blog post about
> | it.  Maybe on the weekend...
> 
> I forgot to give the URL:
> 
> https://r-forge.r-project.org/scm/viewvc.php/pkg/inst/examples/qt/?root=rinside
> 

But your code still creates R instance in "main", which it then passes to the QtDensity instance (a subclass of QtMainWindow). OTOH, once the R instance is stored as a member variable of QtDensity, it *is* used in QtDensity's methods. 

But I'm quibbling -- it's a good pattern to follow, so Cesar could perhaps just adapt it to his code.

Davor


More information about the Rcpp-devel mailing list