Re: [R] R 2.6 and library(survival)

From: Ben Bolker <>
Date: Sat, 24 Nov 2007 19:52:45 -0800 (PST)

makis motakis-2 wrote:
> Hi all,
> I have installed in R 2.6 the survival package and I am trying to analyze
> some
> data and present plots. The problem occurs when I try to plot lines on
> the same plot. E.g. take simulated data for time (t), event (e) and groups
> (group1 and group2) and do:
> ### this is how I create the plots
> plot1<-survfit(Surv(t,e)~ as.factor(group1))
> plot2<-survfit(Surv(t,e)~ as.factor(group2))
> plot(plot1)
> lines(plot2,type="s")
> Error in rep(2, n2 - 1) : invalid 'times' argument
> The plot is created (plot1) but the lines (plot2) are not. I have run this
> same program
> several times from my previous pc (R 2.4 was installed)and I never had
> such a problem.
> Now suddenly this error message appears and it concerns only the survival
> package (I mean
> for simple plots there is no problem to plot lines in an existing plot).
> Is there a problem
> with R 2.6 on this matter? Can someone please help?

Don't know ... a simple reproducible example would help ...

(Some really really trivial things I tried worked, for example:

z = rexp(100)

f1 = factor(rep(1:5,each=20))
f2 = factor(rep(1:2,each=50))
event = rep(1,100)

s1 = survfit(Surv(z,event)~f1)
s2 = survfit(Surv(z,event)~f2)

> sessionInfo()

R version 2.6.0 (2007-10-03)


attached base packages:

[1] splines   stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] survival_2.34

  Ben Bolker

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 25 Nov 2007 - 03:55:38 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 25 Nov 2007 - 11:30:15 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.