[R] Processing calendar dates with R

Karl Knoblick karlknoblich at yahoo.de
Fri Dec 5 16:41:21 CET 2003


Hi!

Don't konw much, but I worked with package "chron",
function "dates":

d2<-"2002-01-21"
d1<-"2001-01-01"
dates(d2, format="y-m-d") -dates(d1, format="y-m-d")
# gives:
# Time in days:
# [1] 385

Actually I used something like 
dates(as.character(d2), format="y-m-d") 
cause the variable was read form a table as factor.

Good luck!
Karl




More information about the R-help mailing list