closest_date | R Documentation |
This finds the closest date to a given date that exists in a dataset.
closest_date(data, date, type = "all", force_val = T)
data |
A data frame that includes a column 'timestamp' |
date |
The date you want to match' |
type |
Default "all", which returns closest date overall. Other options are "before", "after", "beforeequal", and "afterequal"' |
force_val |
Default True. If True, then the function will return the "all" type if there is no date given for the type |
closest_date(data = df, date = "2020-01-01", type = "all", force_val = T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.