The R Project SVN R

Rev

Rev 59039 | Rev 68948 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59039 Rev 61150
Line 41... Line 41...
41
 
41
 
42
\examples{
42
\examples{
43
## first days of years
43
## first days of years
44
seq(as.Date("1910/1/1"), as.Date("1999/1/1"), "years")
44
seq(as.Date("1910/1/1"), as.Date("1999/1/1"), "years")
45
## by month
45
## by month
46
seq(as.Date("2000/1/1"), by="month", length.out=12)
46
seq(as.Date("2000/1/1"), by = "month", length.out = 12)
47
## quarters
47
## quarters
48
seq(as.Date("2000/1/1"), as.Date("2003/1/1"), by="3 months")
48
seq(as.Date("2000/1/1"), as.Date("2003/1/1"), by = "3 months")
49
 
49
 
50
## find all 7th of the month between two dates, the last being a 7th.
50
## find all 7th of the month between two dates, the last being a 7th.
51
st <- as.Date("1998-12-17")
51
st <- as.Date("1998-12-17")
52
en <- as.Date("2000-1-7")
52
en <- as.Date("2000-1-7")
53
ll <- seq(en, st, by="-1 month")
53
ll <- seq(en, st, by = "-1 month")
54
rev(ll[ll > st & ll < en])
54
rev(ll[ll > st & ll < en])
55
}
55
}
56
\keyword{manip}
56
\keyword{manip}
57
\keyword{chron}
57
\keyword{chron}