[Rcpp-devel] R Embedded in a class function

Dirk Eddelbuettel edd at debian.org
Thu Mar 17 23:03:52 CET 2011


On 17 March 2011 at 14:33, Davor Cubranic wrote:
| If you have some specific code, that would help. If you by "class function" you mean to ask "is it possible to create an embedded R instance inside a method?", then the answer is "yes". But there are several things you may be doing incorrectly, and seeing your code would mean we can address the one that is the problem.

Yes, well put Davor.

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

Dirk
 
| Davor
| 
| 
| On 2011-03-17, at 2:11 PM, CESAR PERNALETE wrote:
| 
| > I need to embed an R function in a class function. I have seen in all of the examples that the embed of R always is made in the main function. It possible to do it in a class function? 
| > How would be? 
| > 
| > I tried to do it, and first argc, argv variables were expected. Then i assigned values to this variables in this way: 
| > 
| > const char *agv = "./main";  //No parameters are needed by the main function 
| > int agc = 1; 
| > RInside R(agc,&agv);  // create an embedded R instance 
| > 
| > In this case no error were found at compiling, but the embed didn't work. 
| > 
| > If some of you have some idea i would appreciate your help. 
| 
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list