[R] bug?

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Mar 9 18:33:10 CET 1999

> From: Mai Zhou <mai at ms.uky.edu>
> Windows 9*/NT version, on an NT box  
> R 0.63.0 Beta (Nov 13, 1998)
> > library(survival4) 
> > test <- function(x,d) {
>       survfit(Surv(x,d) ~1)
> }
> > test( rexp(50), sample(c(0,1), size=50, replace=T) )
> Error: Object "x" not found
> > 
> Other functions like in the ctest library works out
> OK, the x and d got passed to the inner function.
> And here it did not got passed to Surv(), I guess.
> Is it solved in 0.63.3? Should I upgrade to 0.63.3? 

It does not give me an error in R-0.63.3, but I _think_ the
problem is actually in the version of survival4 you have. This used to have
        m <- eval(m, sys.parent())
instead of
        m <- eval(m, sys.frame(sys.parent()))
in several places, for example in survfit.

> The problem is that I am in the middle of teaching a course
> and 0.63.0 is the version we started with. 
> Hate to tell them they all have to upgrade (many of them are
> off line).
> It would be better if there is a simple fix. (not upgrading) Thanks. 

Try patching survfit as above.  I would suggest you upgrade survival4
to 1.3-0 and that means upgrading to rw0632 at least. You can't upgrade
to R-0.63.3 on Windows NT for a few days yet: it not released (and
don't use the pretest in a class, pl..e..a..se.)

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list