I started using lubridate today. I have one variable called Started which is the date on which human sujbects enrolled in a study and another variable is called dos1 which is the date upon which the subject last had surgery. I want to work out how many months since their last surgery to the day of enrollment
as.period(syrrupan$Started-syrrupan$dos1,units=c("month"))
I was expecting this to give me something such as 14, 18, 1, 26 With each number being the number of months. Instead I get
1 year, -4 months, -5 days and -1 hours 1 year, -5 months, -23 days and -1 hours 1 year, -7 months, 2 days and -1 hours 1 year, -8 months, -28 days and 1 hour 1 year, -7 months, -23 days and 1 hour.
Furthermore my resultant vector does not wrap within the R console wedding. It just goes on forever to the right.
How do I fix it?