Stavros Macrakis wrote:

It would of course be nice if the existing difftime class could be fit
into this, as it is currently pretty much a second-class citizen.  For
example, c of two time differences is currently a numeric vector,
losing its units (hours, days, etc.) completely.

That's actually a generic feature/issue of c(). We also have

> c(factor(1),factor(3))
[1] 1 1
> library(survival)
Loading required package: splines
> c(Surv(1,T),Surv(2,F))
[1] 1 1 2 0

and similar issues apply to rbind() of data frames,

> rbind(data.frame(s=Surv(1,T)),data.frame(s=Surv(2,F)))
  s.time s.status
1      1        1
2      2        0

There is some potential for redesigning this, using a concat() generic which should do the Right Thing for all classed vector-like objects. (There is such a function in Splus, but I don't their data frame code is using it.)

--
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalga...@biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
R-help@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.

Reply via email to