Get unique years from a data frame
get_yrs.Rd
'get_yrs' extracts and returns the sorted unique years from the 'year' column of a data frame.
Examples
df <- data.frame(year = c(2020, 2021, 2020, 2022))
get_yrs(df)
#> [1] 2020 2021 2022
get_yrs.Rd
'get_yrs' extracts and returns the sorted unique years from the 'year' column of a data frame.
df <- data.frame(year = c(2020, 2021, 2020, 2022))
get_yrs(df)
#> [1] 2020 2021 2022