as_yearqtr | R Documentation |
as_yearqtr()
and as_yearmon()
are included for interoperability with
zoo::yearqtr()
, an alternative year-quarter format that is based on a
decimal representation as opposed to dint's integer representation of
year-quarters. as_yearweek()
follows a similar idea, but there is no
corresponding S3 class in zoo. These functions were included
for cases where you need a continuous representation of date_xx
objects
other then base::Date()
(for example, they are used by scale_date_xx)
as_yearqtr(x) ## S3 method for class 'date_yq' as_yearqtr(x) ## S3 method for class 'yearqtr' as_yearqtr(x) as_yearmon(x) ## S3 method for class 'date_ym' as_yearmon(x) ## S3 method for class 'yearmon' as_yearmon(x) as_yearweek(x) ## S3 method for class 'date_yw' as_yearweek(x) ## S3 method for class 'yearweek' as_yearweek(x)
x |
any R object |
a zoo::yearqtr, zoo::yearmon or dint::yearweek
vector.
q <- date_yq(2016, 1:4) as.numeric(q) qzoo <- as_yearqtr(q) as.numeric(qzoo) m <- date_ym(2016, 1:12) as.numeric(m) mzoo <- as_yearmon(m) as.numeric(mzoo) w <- date_yw(2016, 1:52) as.numeric(w) wzoo <- as_yearweek(w) as.numeric(wzoo)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.