[R] dates
Thomas Lumley
thomas at biostat.washington.edu
Wed Jun 16 02:42:57 CEST 1999
On Tue, 15 Jun 1999, Richard A. Bilonick wrote:
> In S-Plus, there is a dates function, for example:
>
> dates("12/31/99")
>
> Is there a similar function in R?
Try the chron or date packages.
eg
R> library(date)
R> as.date("12/31/99")
[1] 31Dec99
R> as.numeric(.Last.value)
[1] 14609 #days since 1/1/1960
R> as.date("1/1/2000") -as.date("12/31/99")
[1] 1
Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list