as_yearquarter | R Documentation |
as_yearquarter()
is a generic for coercing input in to <grates_yearquarter>
.
Character input is first parsed using as.Date()
. POSIXct and POSIXlt are
all converted, with the timezone respected.
as_yearquarter(x, ...)
## Default S3 method:
as_yearquarter(x, ...)
## S3 method for class 'Date'
as_yearquarter(x, ...)
## S3 method for class 'POSIXt'
as_yearquarter(x, ...)
## S3 method for class 'character'
as_yearquarter(x, ...)
## S3 method for class 'factor'
as_yearquarter(x, ...)
x |
R object |
... |
Only used For character input where additional arguments are passed through
to |
A <grates_yearquarter>
object.
Internally <grates_yearquarter>
objects are stored as the number of
quarters (starting at 0) since the Unix Epoch (1970-01-01).
as.Date()
as_yearquarter(Sys.Date())
as_yearquarter(as.POSIXct("2019-03-04 01:01:01", tz = "America/New_York"), interval = 2)
as_yearquarter("2019-05-03")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.