On Jun 22, 2010, at 1:33 PM, Gustaf Rydevik wrote:

On Thu, Jun 10, 2010 at 3:39 PM, Gustaf Rydevik
<gustaf.ryde...@gmail.com> wrote:
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



As a followup, the change in how to treat difftime objects break even
more of my old code in a different project, since I'm used to treating
difftime as numeric in regressions and other analysis.
And the error messages  become *very* obscure, I.e "Error: NA/NaN/Inf
in foreign function call (arg 2)" when applying loess to a difftime
object. Tracking down the source of those errors become quite a
nuisance.
I suppose there's no chance of reversing the change, but I'd
appreciate if someone could tell me the reason for introducing it so
abrubtly.

Cannot help you there, but have you looked at the help page for difftime?

"The as.double method returns the numeric value expressed in the specified units. Using units = "auto" means the units of the object."


I'm cc'ing this to R-help, since there's probably more people than me
that will be bitten by this in the future when looking into old
projects.

Regards,
Gustaf Rydevik.


David Winsemius, MD
West Hartford, CT

______________________________________________
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