Skip to contents

Convert a vector of observation dates to a ordered sequence of every day in the time series

Usage

full_seq_dates(dates, period = "1 day", anchor = "start", fmt = "%d %b")

Arguments

dates

a vector of dates, possibly including NA values

period

the gap between observations as a number or, a negative number means the resulting sequence defines a end of time periods, a positive defines the beginning. may be an integer number of days, or a text string like '2 weeks', '-1 month', etc.

anchor

defines the day of week the periods start or end. either "start", "end", a day of the week, or a date

fmt

a strptime formatting string for date range labels.

Value

a vector of dates for complete between the minimum and maximum of dates, on the day of week of the anchoring date

Examples

# full_seq_dates(c("2020-01-01","2020-02-01","2020-01-15","2020-02-01",NA), "2 days")