Description Usage Arguments Details Examples

Elapsed dates (monthly, quarterly)

1 2 3 4 5 6 7 | ```
as.quarterly(x)
is.quarterly(x)
as.monthly(x)
is.monthly(x)
``` |

`x` |
a vector |

Monthly and quarterly dates are stored as integers, representing the number of elapsed calendar periods since 01/01/1970. As `yearmonth`

and `yearqtr`

the package `zoo`

, these dates are printed in a way that fits their frequency (`YYY`

q`q`

, `YYY`

m`MM`

). The only difference is that, `monthly`

, and `quarterly`

are integers, which removes issues due to floating points (particularly important when merging). This also allows to use arithmetic on perios, ie `date`

+ 1 adds one period rather than one day.

Methods to convert from and to Dates or POSIXlt are provided. In particular, you may use lubridate `week`

`month`

and `year`

to extract information from elapsed dates.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
library(lubridate)
library(dplyr)
date <- mdy(c("04/03/1992", "01/04/1992", "03/15/1992"))
datem <- as.monthly(date)
is.monthly(datem)
as.quarterly(date)
as.character(datem)
datem + 1
df <- tibble(datem)
# filter(df, month(datem) == 1)
lag(c(1, 2, 3), n = 1, along_with = datem)
seq(datem[1], datem[2])
as.Date(datem)
as.POSIXlt(datem)
as.POSIXct(datem)
week(datem)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.