[Rd] R embedded reinitialization error (PR#12644)

fox_fzseud at trashmail.net fox_fzseud at trashmail.net
Sat Aug 30 14:30:06 CEST 2008

Full_Name: R Embedder
Version: 2.7.2 
OS: win XP SP 2
Submission from: (NULL) (

I'm having problems using embedded R. I try to adapt examples from
Everything works fine except when I try to reinitialize R for the second time
in the same program. I need to reinitialize correctly because my code
is some kind of .dll plugin to an external application.
The simplest example I can provide is a modified tests/Embedding/Rplot.c file
with one line added.
Here each call to "eval_R_command" contains complete
of embedded R. Second call to eval_R_command fails:


#include "embeddedRCall.h"
int main(int argc, char *argv[]) {
    eval_R_command("plot", argc, argv); // this completes OK
    eval_R_command("plot", argc, argv); // this line is added and fails

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

Increasing stack size to 10 MB did not help.
I use latest Rtools gcc toolchain.

More information about the R-devel mailing list