I want to convert a column, day of year (DoY) of the dataframe df to date format into a new column called date for the year 2015. However, my code is giving me error "Error in charToDate(x): character string in not in a unambiguous format".
# Here is my code
df$date<-rep(0, nrow(df))
df$date<- as.Date(df$DoY, origin = "2015-01-01")