I've read the help for as.Date: "Date Conversion Functions to and from
Character" but the method as.character(x ...) isn't working for me:

str(dp)
'data.frame':   113569 obs. of  2 variables:
 $ rainfall.sampdate: Date, format: "2005-01-01" "2005-01-02" ...
 $ rainfall.prcp    : num  0.59 0.08 0.1 0 0 0.02 0.05 0.1 0 0.02 ...
dp$sampdate <- as.Character(dp$sampdate)
Error in `$<-.data.frame`(`*tmp*`, sampdata, value = character(0)) :
  replacement has 0 rows, data has 113569

  I don't understand the error message and want to learn what I've done
incorrectly.

Regards,

Rich

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to