[Rd] Date vs date

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sat Sep 15 17:56:32 CEST 2007


Prof Brian Ripley wrote:
>>> Arguably, it should (Is this a difftime object? Which units?).
>>> I'd advise against numeric operation on difftime objects in general,
>>> because of the unspecified units. These are always "days" when working
>>> with Date objects, but with general time objects it is not predictable.
>>> So I'd recommend sqrt(as.numeric(temp, units="days")).
>>>       
>
> It fails by design.  Using sqrt() on a measurement that has an arbitrary 
> origin would not have been good design.
Er, _diff_time objects do have a well-defined origin at zero. Taking 
square roots (or exp, or...) of a number which  could be weeks as well 
as days is the real issue, I think.

-- 
   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.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-devel mailing list