On 26 March 2016 at 11:35, roste...@abo.fi wrote: | rinside_sample1 can only be invoked once, i.e. RInside R remains hanging | after returning form the function when invoking it as a function. How | can it be invoked multiple times, some way of freeing the instance of R | is needed? Simple delete R does not work.
You instantiate R once and it remains running. That is just how R works and has nothing to do with RInside. Think of it as a global 'state' you access. The qt/ example pass it around. If you need / wants function, you have to give them access to the (single) R instance. See eg examples/qt/ where main.cpp instantiates an R object and passes it to the QtDensity class which receives it as a reference it stores in a private member variable. And a R instance that is properly setup can be calling as many times as you want, just like a long-running R session in your shell, RStudio, ... Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel