Convert a date into a year
as_year(x)
x
base::as.Date()
A character vector representing the years of the input
character
# Retrieve only the year as_year("1988-01-01")