## To get start, end and sequence of last 2 weeks,
## exclude current week
last2weeks <- last_n_weeks(n = 2)
## include current week
last2weeks_2 <- last_n_weeks(n = 2, include_current = TRUE)
## Get last 2 week with start on Sunday
lastWeek <- last_n_weeks(n = 2, week_start = 7)
## To get vector of date sequences
last_n_weeks(n = 2, part = "sequence")
last_n_weeks(n = 2)$sequence
seq(last2weeks)
## Get number of days of last 2 weeks
day_nums <- last_n_weeks(n = 2, part = "length")
last_n_weeks()$length
length(last2weeks)
Run the code above in your browser using DataLab