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