## To get start, end and sequence of previous weeks
previousweek <- previous_week()
## Get previous week with start on Sunday
previousweeksun <- previous_week(week_start = 7)
## To get vector of date sequences
previous_week(part = "sequence")
previous_week()$sequence
seq(previousweek)
## Get number of days of previous 2 weeks
day_nums <- previous_week(part = "length")
previous_week()$length
length(previousweek)
Run the code above in your browser using DataLab