The best way to get years between two dates in R -


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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -