Check for unbalanced quotes or comments. try:
count.fields("RWM Shopper Tracker - RAW DATA - 22JUN09 - Copy.csv",
quote='', comment.char='',
sep=",")
On Mon, Jun 22, 2009 at 9:38 PM, Chris Howden <[email protected]>wrote:
> Morning all,
>
> I'm trying to read in a csv file and R is having some problems. For some
> reason its not 'seeing' all the columns for each row, and as such is not
> reading in the file.
>
> I've opened the file in EXCEL and I can't see any problems with it. All
> rows
> have the correct number of columns.
>
> The code and error messages I've used are below. I've also run
> 'count'fields" and have included that output too.
>
> Any help or suggestions would be much appreciated.
>
> Thanks
>
>
> <-read.table("RWM Shopper Tracker - RAW DATA - 22JUN09 - Copy.csv",
> header=TRUE, sep =",", row.names=NULL)
>
> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
> :
> line 13 did not have 2264 elements
>
>
> > count.fields("RWM Shopper Tracker - RAW DATA - 22JUN09 - Copy.csv",
> sep=",")
> [1] 2264 2264 2264 2264 2264 2264 2264 2264 2264 2264 384 2264 2264
> 384 2264 2264 2264 2264 2264 2264 2264 2264
> [23] 2264 2264 2264 2264 152 2264 384 2264 2264 2264 2264 2264 2264
> 2264 2264 2264 2264 2264 2264 2264 2264 2264
>
>
> Chris Howden
> Marketing Scientist
> For all your Analysis, Modelling, Experimental Design and Training needs
> (mobile) 0410 689 945
> (fax / office) (+618) 8952 7878
> [email protected]
>
> ______________________________________________
> [email protected] mailing list
> 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.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem that you are trying to solve?
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
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.