This function takes the data year, if empty it will select the last one.
Usage
handle_data_year(data_year = NULL, data, date_var)
Arguments
- data_year
The data year to use for filtering (NULL by default).
- data
The dataset
- date_var
The variable with the dates, in years
Value
The data year to use for filtering, last one if none passed in.