[Rd] chron vs. POSIX
Duncan Murdoch
murdoch at stats.uwo.ca
Sat Jul 15 22:31:02 CEST 2006
On 7/15/2006 1:37 PM, Gabor Grothendieck wrote:
> On 7/15/06, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
>> On 7/15/2006 1:01 PM, Gabor Grothendieck wrote:
>>> On 7/14/06, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
>>>> On 7/14/2006 3:38 PM, Sebastian Luque wrote:
>>>>> Hi,
>>>>>
>>>>> One of the big decisions when writing code is how to handle dates and
>>>>> times. Gabor Grothendieck provided an excellent overview of the issue in
>>>>> his R News 4/1 (2004) article, and many users and developers are probably
>>>>> using it as a guide. The proposed guideline is to use the simplest class
>>>>> required; as Gabor put it "use Date if possible, otherwise use chron, and
>>>>> otherwise use POSIX".
>>>>>
>>>>> This seems to me a very efficient strategy, judging from my own
>>>>> experiences and those of others users. All but the simplest calculations
>>>>> with POSIX objects demand great care, due to time zone and and daylight
>>>>> savings considerations. Therefore, I've always chosen chron for
>>>>> relatively complex projects, where I don't need to deal with time zones or
>>>>> daylight savings problems. The ease with which objects can be switched
>>>>> from numeric to chron representations is a major advantage IMHO¹.
>>>>>
>>>>> If Gabor's recommendations are to be followed, wouldn't it make sense to
>>>>> include chron in base R? Given that flexibility for handling time
>>>>> variables is so fundamental, the addition of chron to base R would provide
>>>>> users everything they need to work with time, without the need to rely on
>>>>> an external package. What do others think?
>>>> Putting something into base R essentially means that it is to be taken
>>>> over by R core. I think chron is being adequately maintained now (the R
>>>> maintainer is already a member of R core), so I don't see a need for that.
>>>>
>>>> I don't see a problem having a package on CRAN. If it's a good package
>>>> and people realize that it's good, and it remains available for others
>>>> to use, then what problem is being solved?
>>> I think the problem is that there is nothing to signal its importance. Perhaps
>>> chron should be added to the "recommended" package list.
>> I think that would be preferable to making it a base package, but it's
>> not the only way to publicize it. Why not add something to the Wiki to
>> compare the various possibilities for storing dates and times?
>
> As a recommended package it would be included in all binary releases
> ensuring access without a separate install and would provide more
> official endorsement.
Yes, but that wasn't my question. A Wiki entry on dates and times would
be useful whether chron is a recommended package or not. Why don't you
write one based on your R News article, or at least write what you like
about chron? The nice thing about wikis is that if you write anything
inaccurate, someone else will come along and correct you; if you miss
something, someone will add it.
Duncan Murdoch
More information about the R-devel
mailing list