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

From: <fox_fzseud_at_trashmail.net>
Date: Sat, 30 Aug 2008 14:30:06 +0200 (CEST)

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 "tests/Embedding/".
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 initialization/deinitialization
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     return(0);

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.

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 30 Aug 2008 - 14:17:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 31 Aug 2008 - 20:39:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive