[Rd] R API for C/C++ initialisation issue appears with update to R.3.5

Andéol Evain @ndeol@ev@in @ending from gm@il@com
Thu Jul 12 17:15:49 CEST 2018


Hello everyone,

I have a C++ program that calls R using R_tryEval, very similarly to what
package RInside does.
It used to work with R.3.4.3 and R.3.4.4. However, since I updated it to
R.3.5.1, R sends an error message: "*Error in < My command > : the base
graphics system is not registered*"  for any command related to the
graphics package.

I made a ticket on stackoverflow about it: https://stackoverflow.com/
questions/51242993/difference-between-r-3-4-4-and-r-3-5-1-in-r-api-for-c

But nobody could explain why so far. And after reducing my code further, I
am now enclined to think this is actually a bug.

The code provided in stackOverflow is already reduced, but not minimal yet.
Since then, I reduced it further to really ensure that it was not an
interference from anything around it. So I removed the GUI and the
callbacks.
Here is a really minimal example attached.

In its current form, the program just sends the command :   par("mar") to
R, and then the command  dev.off()   .
With R.3.4.4, this program print as output what is expected. No error
occured during evaluation of the command :









*No error occured during eval of "par(\"mar\")"EXAMPLE #1 Output: EXAMPLE
#1 Output: Result is:  "5.1"Result is:  "5.1"Result is:  "5.1"Result is:
"5.1"No error occured during eval of "dev.off()"Result is:  "1"*

But the exact same program with R.3.5.1 gives:





*An error occured during eval of "par(\"mar\")"No error occured during eval
of "dev.off()"Result is:  "1"*

The error that occured is not displayed here, since I removed the callbacks
to fetch it, but it was:
*Error in par("mar") : the base graphics system is not registered*


I compiled Microsoft Visual C++ Compiler 15.0 (amd64), and uses 64bits
version of R. But previously I also observed the same behovior with 32bits.
I also tried re-installing R from scratch, without effect.

I am using Windows 10, 64bits
Registry variables PATH and R_HOME are correctly set and points to the
appropriate version of R, installed in the default directory.

I'd be glad to hear any ideas about potential fixes or workaround.

Cheers,

Andéol Evain

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.cpp
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20180712/decb3068/attachment.ksh>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rmanager.h
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20180712/decb3068/attachment.h>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rmanager.cpp
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20180712/decb3068/attachment-0001.ksh>


More information about the R-devel mailing list