Description Usage Arguments Details Value Note See Also Examples
The method for seq
for objects of class class
"Date"
representing calendar dates.
1 2 |
from |
starting date. Required |
to |
end date. Optional. |
by |
increment of the sequence. Optional. See ‘Details’. |
length.out |
integer, optional. Desired length of the sequence. |
along.with |
take the length from the length of this argument. |
... |
arguments passed to or from other methods. |
by
can be specified in several ways.
A number, taken to be in days.
A object of class difftime
A character string, containing one of "day"
,
"week"
, "month"
, "quarter"
or "year"
.
This can optionally be preceded by a (positive or negative) integer
and a space, or followed by "s"
.
See seq.POSIXt
for the details of "month"
.
A vector of class "Date"
.
Quarterly increments were specified by by = "3 months"
prior to
R 3.1.0.
1 2 3 4 5 6 7 8 9 10 11 12 | ## first days of years
seq(as.Date("1910/1/1"), as.Date("1999/1/1"), "years")
## by month
seq(as.Date("2000/1/1"), by = "month", length.out = 12)
## quarters
seq(as.Date("2000/1/1"), as.Date("2003/1/1"), by = "quarter")
## find all 7th of the month between two dates, the last being a 7th.
st <- as.Date("1998-12-17")
en <- as.Date("2000-1-7")
ll <- seq(en, st, by = "-1 month")
rev(ll[ll > st & ll < en])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.