Input a township name or code and get the assessment year closest to the year argument. Current year is the default. Will never return a year higher than the current year.

Ex. town_get_assmnt_year("Evanston") outputs 2019

town_get_assmnt_year(
  town,
  year = as.integer(format(Sys.Date(), "%Y")),
  round_type = "nearest"
)

Arguments

town

Vector of township names or numeric codes. Township name must be title case to match correctly.

year

Default current year. Year to find assessment year closest to. For example, entering 1995 will find the closest assessment year to 1995 for all the entered triads. Can also be a vector of years the same length as town.

round_type

Default "nearest". The type of rounding to use to find the closest assessment year. Nearest will find the nearest. Floor will find the assessment year prior to year. Ceiling will find the assessment year after year.

Value

Numeric vector of assessment years relative to the year entered. Returns NA for towns that cannot be found.

Examples


town_get_assmnt_year("Evanston")
#> [1] 2025

town_get_assmnt_year(c("Lyons", "10", "Worth"), year = 1997)
#> [1] 1996 1998 1996

town_get_assmnt_year(c("Lyons", "10", "25"), round_type = "floor")
#> [1] 2023 2022 2022