[R] difftime in years

Thomas Subia tgs77m at yahoo.com
Thu Aug 4 20:05:55 CEST 2016


age_days <- difftime(Date,DOM,units="days")
date_vals$age_yrs <-  age_days/365.242

I'm trying to calculate the number of years between DOM and Date.
The output reads

             DOM               Date                 age_yrs
1 2005-04-04   2015-05-13           10.10563 days

How does one not output days?

More information about the R-help mailing list