I am trying to run a simple regression in R (mac OSX), to see if the level of an environmental certification has improved over time - among other things. The data I downloaded offers a level from 1-4, and the dates in 1-Mar-12 format. I can't seem to get R to convert the dates, and I keep getting the same error message. The variables are the same length.
$ certification_date: chr "1-Aug-11" "1-Aug-11" "1-Aug-11" "1-Jul-11" ...
jday<-as.Date('certification_date',format='%d-%b-%y',"%j")
mod <- lm(Level_number ~ jday, data=data)
Error in model.frame.default(formula = Level_number ~ jday, data = data, :
variable lengths differ (found for 'jday')
summary(jday)
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
NA NA NA NA NA NA "1"
Can anyone spot where I've gone wrong?