I have one variable called Started
which is the date on which human subjects enrolled in a study and another variable called dos1
which is the date
You could try using difftime
instead, ie:
difftime(syrrupan$Started,syrrupan$dos1,units="days")
Note that this will give you an object of class difftime
, if you want a numeric vector, wrap an as.numeric
around it. Note also that you can't choose months as an option for units, but you should really stick with a time unit that has a fixed length.