# Compute an individual's age in years
x <- year_day(2001, 100)
y <- year_day(2021, c(99, 101))
calendar_count_between(x, y, "year")
# Or in a whole number multiple of years
calendar_count_between(x, y, "year", n = 3)
Run the code above in your browser using DataLab