## To get start, end and sequence of last 2 months,
## exclude current month
last2month <- last_n_months(n = 2)
## include current month
last2month_2 <- last_n_months(n = 2, include_current = TRUE)
## To get vector of date sequences
last_n_months(n = 2, part = "sequence")
last_n_months(n = 2)$sequence
seq(last2month)
## Get number of days of last 2 months
day_nums <- last_n_months(n = 2, part = "length")
last_n_months()$length
length(last2month)
Run the code above in your browser using DataLab