The best way to get years between two dates in R -
this question has answer here:
i'd calculate difference between 2 dates in years decimal values. let's have "1978-08-25" , "2014-02-05" (%y-%m-%d). how can calculate difference between these 2 dates in years decimal values (ie. not 35 years, 35.95...years)? thank in advance.
you check out zoo
package.
x = as.yearmon("2014-02-05") y = as.yearmon("1978-08-25") x - y [1] 35.5
Comments
Post a Comment