I have a data file, 'precip_projected.csv,' that starts like this:

name,easting,northing,elev,sampdate,prcp
Headworks Portland Water,2370575.38427211,199337.634652112,228,2005-01-01,0.59
Headworks Portland Water,2370575.38427211,199337.634652112,228,2005-01-02,0.08
Headworks Portland Water,2370575.38427211,199337.634652112,228,2005-01-03,0.1
Headworks Portland Water,2370575.38427211,199337.634652112,228,2005-01-04,0
Headworks Portland Water,2370575.38427211,199337.634652112,228,2005-01-05,0
Headworks Portland Water,2370575.38427211,199337.634652112,228,2005-01-06,0.02
Headworks Portland Water,2370575.38427211,199337.634652112,228,2005-01-07,0.05
Headworks Portland Water,2370575.38427211,199337.634652112,228,2005-01-08,0.1
Headworks Portland Water,2370575.38427211,199337.634652112,228,2005-01-09,0
Headworks Portland Water,2370575.38427211,199337.634652112,228,2005-01-10,0.02

  There are a bunch of NAs in the data file.

  The command to read it produces an error:

rainfall <- read.csv('../data/precipitation/precip_projected.csv', header = T, 
sep = ',', as.is = T)

Error in `$<-.data.frame`(`*tmp*`, date, value = numeric(0)) :
  replacement has 0 rows, data has 113569

  Is the error generated by finding a date that looks like the number zero
or by a prcp value of zero?

  BTW, I get the same error if I specify stringsAsFactors = F.

TIA,

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