Date difference in years
diff_years.Rd
Calculate date difference in years, taking into account leap years.
Details
Since the number of days in a year changes depending on whether said year is a leap year, dividing a period of time by estimates such as 365.25, 365.241, 365.24442 will be slightly biased. The correct way to calculate a length of period in years is to take into account which years are leap years and divide by 365 or 366 as needed.