[Rd] calling Rf_initEmbeddedR twice gives an error

Soeren Sonnenburg r-ml at nn7.de
Thu Mar 5 09:33:27 CET 2009


Dear all,

I've written a R to python/octave/r translator that (so you can call
python from R etc and vice versa) enabling you to e.g. call matplotlib
which just runs fine on the first command

when I do

    Rf_initEmbeddedR(2, argv);
    Rf_endEmbeddedR(0);

    Rf_initEmbeddedR(2, argv);
    Rf_endEmbeddedR(0);

I get this error

Error in .Call("R_isMethodsDispatchOn", onOff, PACKAGE = "base") : 
  Incorrect number of arguments (2), expecting 1 for R_isMethodsDispatchOn
Error in gzfile(file) : invalid 'encoding' argument
Fatal error: unable to restore saved data in .RData


I've recognized that there were others with that problem - which is
marked user error here
http://bugs.r-project.org/cgi-bin/R/trashcan?id=12644;user=guest;selectid=12644


Unfortunately it is nowhere stated what one should have called...   Any
of
    R_dot_Last();
    R_RunExitFinalizers();
    R_gc();

does not help either...

However I can trigger the problem on the R cmdline when I do:
.Call("R_isMethodsDispatchOn", 1,2, PACKAGE = "base") : 

also looking at src/main/registration.c I don't see a reason why it
should be wrong:    CALLDEF(R_isMethodsDispatchOn, 1)...

Any ideas?

Soeren



More information about the R-devel mailing list