[Rd] Possible bug in RTERM (PR#14043)

andy at h-ashley.freeserve.co.uk andy at h-ashley.freeserve.co.uk
Wed Nov 4 21:50:15 CET 2009


Full_Name: Andy Ashley
Version: 2.10.0
OS: Windows XP SP3
Submission from: (NULL) (91.105.184.105)


I am updating a legacy program which called Rterm from within Excel VBA as
follows:
    Rexe = """C:\Program Files\R\R-2.4.0\bin\Rterm.exe"""
    Roptions = ""
    env_vars = " R_USER=" & dirname
    cmdstring = Rexe & Roptions & env_vars
    retval = Shell(cmdstring, 6)
    
R then executes .Rprofile
    setwd(“dirname”)
    source('run.R')

I had previously used R 2.4.0 and found that I could call functions in the base
package OK, but if I tried to call a function in stats, I got the error
message:

Error in eval.with.vis(expr,, envir, enclos) :
  could not find function “wilcox.test”

This message is in the Rterm window which appears. If I then type search() in
this window, it tells me that package stats is loaded. I got around the problem
by specifically calling require(stats) at the start of the R code.

I upgraded the version of R used to 2.9.2 and I found that I now get the same
error message for base functions as well, but require(base) does not work. The
same problem occurs in R 2.10.0.

I have had to go back to using R2.4.0 in my application.

I realise that there is the Rexcel interface available, but it should still work
by calling Rterm.



More information about the R-devel mailing list