svensmail@spray.se
2004-Oct-06 18:04 UTC
[Rd] R2.0.0 bug in function vcov in library survival (PR#7266)
Full_Name: Sven Sandin Version: 2.0.0 OS: SuSE Linux 9.0 Submission from: (NULL) (81.227.17.135) Have just compiled and installed R-2.0.0.tar.gz running SuSE9.0. The function vcov do not accept "coxph" object as input any longer. The same R-program running R1.9.1 do work. R-program attached below. Exporting the coxph object from R2.0.0 to R1.9.1 I get vcov ouput in R1.9.1. Exporting the coxph object from R1.9.1 to R2.0.0 I get errors in R2.0.0 =========== Copy of the R-program ======================R : Copyright 2004, The R Foundation for Statistical Computing Version 2.0.0 (2004-10-04), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. [Previously saved workspace restored]> rm(list=ls()) > load("~/R/wlh0301/data/breast.RData") > library(survival)Loading required package: splines> u2<-coxph(Surv(time,event) ~ age + cbmi + smoker + drink , data=breast.1) > tmp <- vcov(u2)Error in vcov(u2) : no applicable method for "vcov"> > class(u2)[1] "coxph"
Prof Brian Ripley
2004-Oct-06 18:29 UTC
[Rd] R2.0.0 bug in function vcov in library survival (PR#7266)
Those vcov methods were removed from stats at 2004-08-28 20:40:13 +0100 survival now has vcov.{coxph,survreg} Looks like they have been removed from survival since: that is where they should be. They are very simple -- vcov.coxph <- vcov.survreg <- function (object, ...) object$var On Wed, 6 Oct 2004 svensmail@spray.se wrote:> Full_Name: Sven Sandin > Version: 2.0.0 > OS: SuSE Linux 9.0 > Submission from: (NULL) (81.227.17.135) > > > Have just compiled and installed R-2.0.0.tar.gz running SuSE9.0. > > The function vcov do not accept "coxph" object as input any longer. > > The same R-program running R1.9.1 do work. R-program attached below. > > Exporting the coxph object from R2.0.0 to R1.9.1 I get vcov ouput in R1.9.1. > Exporting the coxph object from R1.9.1 to R2.0.0 I get errors in R2.0.0 > > =========== Copy of the R-program ======================> R : Copyright 2004, The R Foundation for Statistical Computing > Version 2.0.0 (2004-10-04), ISBN 3-900051-07-0 > > R is free software and comes with ABSOLUTELY NO WARRANTY. > You are welcome to redistribute it under certain conditions. > Type 'license()' or 'licence()' for distribution details. > > R is a collaborative project with many contributors. > Type 'contributors()' for more information and > 'citation()' on how to cite R or R packages in publications. > > Type 'demo()' for some demos, 'help()' for on-line help, or > 'help.start()' for a HTML browser interface to help. > Type 'q()' to quit R. > > [Previously saved workspace restored] > > > rm(list=ls()) > > load("~/R/wlh0301/data/breast.RData") > > library(survival) > Loading required package: splines > > u2<-coxph(Surv(time,event) ~ age + cbmi + smoker + drink , data=breast.1) > > tmp <- vcov(u2) > Error in vcov(u2) : no applicable method for "vcov" > > > > class(u2) > [1] "coxph" > > ______________________________________________ > R-devel@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >-- Brian D. Ripley, ripley@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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Torsten Hothorn
2004-Oct-06 19:23 UTC
[Rd] R2.0.0 bug in function vcov in library survival (PR#7266)
> > Have just compiled and installed R-2.0.0.tar.gz running SuSE9.0. > > The function vcov do not accept "coxph" object as input any longer. > > The same R-program running R1.9.1 do work. R-program attached below. > > Exporting the coxph object from R2.0.0 to R1.9.1 I get vcov ouput in R1.9.1. > Exporting the coxph object from R1.9.1 to R2.0.0 I get errors in R2.0.0 > > =========== Copy of the R-program ======================> R : Copyright 2004, The R Foundation for Statistical Computing > Version 2.0.0 (2004-10-04), ISBN 3-900051-07-0 > > R is free software and comes with ABSOLUTELY NO WARRANTY. > You are welcome to redistribute it under certain conditions. > Type 'license()' or 'licence()' for distribution details. > > R is a collaborative project with many contributors. > Type 'contributors()' for more information and > 'citation()' on how to cite R or R packages in publications. > > Type 'demo()' for some demos, 'help()' for on-line help, or > 'help.start()' for a HTML browser interface to help. > Type 'q()' to quit R. > > [Previously saved workspace restored] > > > rm(list=ls()) > > load("~/R/wlh0301/data/breast.RData") > > library(survival) > Loading required package: splines > > u2<-coxph(Surv(time,event) ~ age + cbmi + smoker + drink , data=breast.1) > > tmp <- vcov(u2) > Error in vcov(u2) : no applicable method for "vcov" > > > > class(u2) > [1] "coxph" >S3method(vcov, coxph) is missing from the NAMESPACE file of package `survival', I think. For the meantime you may use R> survival:::vcov.coxph function (object, ...) { rval <- object$var dimnames(rval) <- list(names(coef(object)), names(coef(object))) rval } <environment: namespace:survival> Torsten> ______________________________________________ > R-devel@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >
tlumley@u.washington.edu
2004-Oct-06 20:06 UTC
[Rd] R2.0.0 bug in function vcov in library survival (PR#7266)
On Wed, 6 Oct 2004, Prof Brian Ripley wrote:> Those vcov methods were removed from stats at > > 2004-08-28 20:40:13 +0100 survival now has vcov.{coxph,survreg} > > Looks like they have been removed from survival since: that is where they > should be. They are very simple -- > > vcov.coxph <- vcov.survreg <- function (object, ...) object$var >No, they haven't been updated to cope with lazy loading (they are defined in a top-level if statement to prevent conflicts in older versions of R). vcov.coxph is actually vcov.coxph<-function (object, ...) { rval<-object$var dimnames(rval)<-list(names(coef(object)),names(coef(object))) rval } since object$var doesn't have dimnames. -thomas
ripley@stats.ox.ac.uk
2004-Oct-06 20:12 UTC
[Rd] Re: R2.0.0 bug in function vcov in library survival (PR#7266)
On Wed, 6 Oct 2004, Thomas Lumley wrote:> On Wed, 6 Oct 2004, Prof Brian Ripley wrote: > > > Those vcov methods were removed from stats at > > > > 2004-08-28 20:40:13 +0100 survival now has vcov.{coxph,survreg} > > > > Looks like they have been removed from survival since: that is where they > > should be. They are very simple -- > > > > vcov.coxph <- vcov.survreg <- function (object, ...) object$var > > > > No, they haven't been updated to cope with lazy loading (they are defined > in a top-level if statement to prevent conflicts in older versions of R). > > vcov.coxph is actually > vcov.coxph<-function (object, ...) { > rval<-object$var > dimnames(rval)<-list(names(coef(object)),names(coef(object))) > rval > } > since object$var doesn't have dimnames.As Torsten has suggested, it looks like they were neither registered nor exported from the survival namespace, but the objects are in the namespace. (Nothing to do with lazy-loading, then.)> library(survival)Loading required package: splines> ls(asNamespace("survival"), patt="^vcov")[1] "vcov.coxph" "vcov.survreg" Please register them in the next update. -- Brian D. Ripley, ripley@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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595