From gustaf.rydevik at gmail.com  Thu Jun 10 15:39:05 2010
From: gustaf.rydevik at gmail.com (Gustaf Rydevik)
Date: Thu, 10 Jun 2010 15:39:05 +0200
Subject: [Rd] Request: difftime method for cut()
In-Reply-To: <AANLkTinJIbhWTP3GYLzr8pMrDJ_ckUzK9USigmFy2mDm@mail.gmail.com>
References: <AANLkTinJIbhWTP3GYLzr8pMrDJ_ckUzK9USigmFy2mDm@mail.gmail.com>
Message-ID: <AANLkTilevxQ4bCQ1GPZK0HbIMOVXTVV2ewteDi4hK7Rm@mail.gmail.com>

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



[Rd] Request: difftime method for cut()
Gustaf Rydevik