What are the start and end date of your study? This function takes in a vector of file names, and export a character string indicating the date range of your study.
Value
A single character string in one of the following format:
"YYMMDD"
when all dates in
df$date
are the same"YYMMDD_YYMMDD"
otherwise, concatenation of start and end dates
Returns NA_character_
(with a warning) if df
has zero rows.
Examples
get_date_range(c("feed/VR200720.DAT", "feed/VR200715.DAT", "feed/VR200716.DAT"))
#> [1] "200715_200720"