calculate days in between in r code example
Example: how to transform a difference in time from days to years in R
start = as.Date("2012-03-01")
end = as.Date("2017-03-01")
# method 2
as.numeric(difftime(end, start, unit = "weeks")) / 52.25
start = as.Date("2012-03-01")
end = as.Date("2017-03-01")
# method 2
as.numeric(difftime(end, start, unit = "weeks")) / 52.25