I have a data frame which has two columns of dates in the format yyyy/mm/dd. I am trying to calculate the number of days between these two dates for each observation within
You need to use the as.Date formats correctly.
Eg.
x = '2012/07/25' xd = as.Date(x,'%Y/%m/%d') xd # Prints "2012-07-25"
R date formats are similary to *nix ones.
Doing a typeof(xd) shows it as a double ie. days since 1970.