[6416] in s-news-athena

home help back first fref pref prev next nref lref last post

DATE ARITHMETIC FUNCTIONS

daemon@ATHENA.MIT.EDU (Emily Dickinson)
Wed Feb 8 19:13:56 1995

Date: Wed, 8 Feb 95 16:46:10 MST
From: emily@predict.com (Emily Dickinson)
To: s-news@utstat.toronto.edu

##############################################################################

Thanks to all for the useful responses to this question:

> Has anyone out there put together a package of date arithmetic
> functions.  E.g., functions to add/subtract a day to a given date, get
> tomorrow's date from today's date, determine whehter or not a given
> date is a weekend, etc.?


For simple date arithmetic see the "blue" book (Becker, Chambers, and Wilks) 
section 9.2.1 (p.268-271)---the code is in library(examples);
S-plus (version 3.2?) has the unsupported library(chron) from Bell Labs;
also, see Terry Thurneau's "date2" package in statlib.

David A James
AT&T Bell Labs

##############################################################################

Section 9.2.1 of the blue book (pp. 268-271) has some of the answers
you're looking for. There's also a contribution called "date" in the S
archive of statlib which may also be useful.

alejandro munoz-del-rio   AB13 Russell Labs (Forestry)  work: (608) 263-0853

##############################################################################

   The "date" package on statlib handles this.  Another is the "chron"
package by David James, which is part of Splus version 3.2 .


 Terry M. Therneau, Ph.D.                        (507) 284-1817 
 Department of Health Science Research           (507) 284-5231  FAX
 Mayo Clinic                                     therneau.terry@mayo.edu
 Rochester, Minn 55905

##############################################################################

Version 3.2 of Splus comes with a whole library package which allows
arithmetic and much more on dates and times. It is not supported by
StatSci so I don't know if your local installation has it. If it has
it should be installed as a library, so as a starting point you
can just type
library(help="chron") for a README file
and
library(chron) to load the package. There is also a doc file on the
ATT anonymsou ftp server, it is mentioned at the end of the README 
file.

-- Reiner --

##############################################################################


home help back first fref pref prev next nref lref last post