Bob Green
2009-Mar-31 21:14 UTC
[R] error message obtained when plotting survival curves (error not previously obtained)
Hello, I now receive an error message when obtaining a survival plot, which was not previously received with the same code. I recently updated all my packages. It does not seem to be a peculiarity of my data as I receive the error using data available in R. A plot is produced but I am uncertain regarding the error message. > library(surv2sample) > data(gastric) > fit <- survfit(Surv(time, event) ~ treatment, data = gastric) Error in get(x, envir = ns, inherits = FALSE) : variable "survfit.km" was not found > #Default plot: > plot(fit) regards Bob Green
David Winsemius
2009-Apr-01 02:55 UTC
[R] error message obtained when plotting survival curves (error not previously obtained)
I cannot reproduce the error: > sessionInfo() R version 2.8.1 Patched (2009-01-19 r47650) i386-apple-darwin9.6.0 locale: en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] splines stats graphics grDevices utils datasets methods base other attached packages: [1] surv2sample_0.1-2 lattice_0.17-20 Design_2.1-2 survival_2.34-1 Hmisc_3.5-2 [6] boot_1.2-35 loaded via a namespace (and not attached): [1] cluster_1.11.12 grid_2.8.1 tools_2.8.1 Be on notice that survfit in Design masks survfit in survival, but no error re-appears after detaching Design and Hmisc. -- David Winsemius On Mar 31, 2009, at 5:14 PM, Bob Green wrote:> > Hello, > > I now receive an error message when obtaining a survival plot, which > was not previously received with the same code. I recently updated > all my packages. It does not seem to be a peculiarity of my data as > I receive the error using data available in R. A plot is produced > but I am uncertain regarding the error message. > > > > > library(surv2sample) > > data(gastric) > > fit <- survfit(Surv(time, event) ~ treatment, data = gastric) > Error in get(x, envir = ns, inherits = FALSE) : > variable "survfit.km" was not found > > #Default plot: > > plot(fit) > > > regards > > Bob Green > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD Heritage Laboratories West Hartford, CT
Thomas Lumley
2009-Apr-01 08:08 UTC
[R] error message obtained when plotting survival curves (error not previously obtained)
On Wed, 1 Apr 2009, Bob Green wrote:> > Hello, > > I now receive an error message when obtaining a survival plot, which was not > previously received with the same code. I recently updated all my packages. It > does not seem to be a peculiarity of my data as I receive the error using data > available in R. A plot is produced but I am uncertain regarding the error > message. > > > >> library(surv2sample) >> data(gastric) >> fit <- survfit(Surv(time, event) ~ treatment, data = gastric) > Error in get(x, envir = ns, inherits = FALSE) : > variable "survfit.km" was not found >> #Default plot: >> plot(fit) >You don't show what packages you have loaded. My guess would be that you are calling Design::survfit rather than survival::survfit, and the problem is due to the incompatibility between the most recent versions of Design and survival. Frank Harrell and the folks at Vanderbilt are working on a new version of Design. -thomas Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle