Skip to contents

This function returns the date from y that is the closest to each date in x.

Usage

time_index(x, y)

Arguments

x

A date vector, typically a column in a dataframe indicating date of observed case or incidence.

y

A vector of dates to search for matches, typically a customized series with specified interval length.

Value

A vector of dates from y that are nearest matches for dates given in x