Re: [Rd] Date vs date

From: Peter Dalgaard <>
Date: Sat, 15 Sep 2007 17:56:32 +0200

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
~~~~~~~~~~ - (                  FAX: (+45) 35327907

______________________________________________ mailing list
Received on Sat 15 Sep 2007 - 15:59:49 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 16 Sep 2007 - 14:40:50 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.