[Rd] Request: difftime method for cut()

Gustaf Rydevik gustaf.rydevik at gmail.com
Thu Jun 10 15:39:05 CEST 2010


Hi all,

The recent change in 2.11 that made as.numeric() return false on
difftime-objects broke some of my code that calculated age classes of
individuals using cut(). While this was no big thing to fix for me, it
might be wise
to provide a cut.difftime method to  stop other old code from breaking.
I'm guessing something as simple as

cut.difftime<-function(x,...){
x<-as.numeric(x)
cut(x,...)
}

would suffice.

best regards,
Gustaf

--
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik



More information about the R-devel mailing list