Skip to contents

This function is specifically meant to ensure that the data in the date_vector specified does not contain dates after a given max_date. The intended use-case for this is to ensure that one doesn't accidentally pass in data that extends beyond the forecast date, as ideally the user is providing vintaged "as of" datasets or at the very least is filtering the data so that they are not including in their inference data that was made available after the forecast was made.

Usage

assert_no_dates_after_max(date_vector, max_date, call = rlang::caller_env())

Arguments

date_vector

vector of dates

max_date

string indicating the maximum date in ISO8601 convention e.g. YYYY-MM-DD

call

Calling environment to be passed to cli::cli_abort() for traceback.

Value

NULL, invisibly