[Rcpp-devel] Calling RInside constructor multiple times

Peter Holt source.code.devel at gmail.com
Fri Jun 11 15:53:05 CEST 2010


Hello List,

I wrote a C++ program that does the following:

**************************************************************

int main (int argc, char **argv)
{
   RInside* temp_1 = new RInside (argc, argv)

   // use temp_1 to load "temp_1.RData", and invoke
   // functions that are defined within "temp_1.RData"

   ......

   // Delete the created RInside instance

   delete temp1;

  // create another RInside instance, as we now would
  // like to load "temp_2.RData" and invoke functions
  // defined within "temp_2.RData"

  RInside* temp_2 = new RInside (argc, argv)

   // use temp_2 to invoke operations within "temp_2.RData"

   ....

   // Delete the created RInside instance

   delete temp_2;
}

*********************************************************************

The above described program crashes when we try to create the "temp_2"
RInside object, and gives the following error:

Error in .Call("R_isMethodsDispatchOn", onOff, PACKAGE = "base") :
  Incorrect number of arguments (2), expecting 1 for R_isMethodsDispatchOn

Can you please let me know what should I do to properly delete the "temp_1"
RInside object, so that I could create "temp_2" RInside object and proceed
with my program?

Thanks,
P.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20100611/1fdefca1/attachment.htm>


More information about the Rcpp-devel mailing list