Re: [R] Understanding read.csv error message [FIXED]

2018-08-18 Thread Rich Shepard
On Sat, 18 Aug 2018, MacQueen, Don wrote: It's not obvious what would be causing that error from read.csv. But here's what I would probably try: I'd try switching to the more general read.table. Don/Peter, I found the problem: it was in the following line in the script which referenced

Re: [R] Understanding read.csv error message

2018-08-18 Thread Ben Tupper
Hi, I would be tempted, as a start, to read the entire file in as rows of text, split each line by the expected delimiter, and then count the number of elements each split line yields. Once you know each row splits into the expected number of txt <- "name,easting,northing,elev,sampdate,prcp

Re: [R] Understanding read.csv error message

2018-08-18 Thread peter dalgaard
What Don said, and also notice that the error is not about anything having value 0, it is about replacing something with something of _length_ 0. It is not obvious where that happens, sometimes a traceback() can give a clue, but probably Don is right that the issue is that there is something

Re: [R] Understanding read.csv error message

2018-08-17 Thread MacQueen, Don via R-help
small typo in previous: should be quote="" (I left behind a single quote by mistake) -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 8/17/18, 5:03 PM, "R-help on behalf of MacQueen, Don via R-help"

Re: [R] Understanding read.csv error message

2018-08-17 Thread MacQueen, Don via R-help
Hi Rich, It's not obvious what would be causing that error from read.csv. But here's what I would probably try: Add quote='"" to your arguments. The default is to use surround text strings with double quotes, but your file doesn't. Copy the first few rows into another file and try it. If it

[R] Understanding read.csv error message

2018-08-17 Thread Rich Shepard
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