span_date | R Documentation |
seq.Date
.Quickly create a sequence of dates from minimal specifications.
span_date(from, to = NULL, len_out = NULL, by = NULL)
from |
Integer or character of length 4 (yyyy), 6 (yyyymm), or 8 (yyymmdd). Indicating the start value of the sequence. |
to |
Integer or character of length 4 (yyyy), 6 (yyyymm), or 8 (yyymmdd). Optional. |
len_out |
The desired length of the sequence. Optional. |
by |
The desired interval. Optional. |
Minimal specification of dates, sets unspecified date parts to default values. These are 01 for both month and day.
In addition to from
, either to
or len_out
must be specified.
If by
is not specified, span_date
will set the interval to the
highest of the specified date parts in either from
or to
.
For example, if they are 2011 and 2015 it will be "year", if they are 2011
and 201501 it will be "month".
An object of class Date.
# using "to" argument span_date(2011, 2015) span_date(201101, 201501) span_date(2011, 2015, by = "month") span_date(2011, 201501) span_date(20111225, 2012) # using "len_out" argument span_date(2011, len_out = 4) span_date(201101, len_out = 4) span_date(20110101, len_out = 4) span_date(20110101, len_out = 4, by = "month")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.