Many functions expect Dates. Determining that they are validly entered is often quite computationally costly, relative to the core calculations. These internal functions provide mechanisms to check validity quickly, while still providing clear, accurate error messages.

validate_date(date_to_verify, from = NULL, to = NULL,
  deparsed = "Date")

Arguments

date_to_verify

(character) A user-provided value, purporting to be character vector of dates.

from, to

Indicating the range of years valid for date_to_verify. Default set to -Inf and Inf respectively (i.e. there is no bound)

deparsed

The name of variable to appear in error messages.

Value

date_to_verify as a Date object, provided it can be converted to a Date and all elements are within the bounds from and to.