View source: R/get_date_range.R
get_date_range | R Documentation |
This function will attempt to auto-detect the date format using lubridate, then determine the minimum and maximum for the submitted vector of dates. It is intended as a helper function for selecting date ranges and adding them to queries.
get_date_range(dates)
dates |
character vector of dates to extract the date range from |
Returns a list object with two values (minimum and maximum date)
Amy Mikhail, amy.mikhail@gmail.com
# Create a character vector of dates:
x <- c("2022-07-15", "2021-08-09", NA, "2022-08-03")
# Get date range:
daterange <- get_date_range(dates = x)
# View the result:
daterange
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.