Skip to content
Prev 13597 / 63421 Next

Glitch involving difftime and data frame

Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:
Hmm. So to get a survival time (say) into a data frame, we should
unclass it? (That $<- works seems coincidental and the resulting data
frame might cause trouble down the line). It does look rather tempting
to do as.data.frame.difftime <- as.data.frame.numeric and begone with
it though....

(It doesn't make much sense to have units other than "days" for Date
differences, so the use of difftime objects is a bit pointless from
the practical perspective, although perhaps not from a consistency
perspective. Any chance of doing months and years?)