Re: [R] Reading in csv with footer

2012-02-13 Thread chuck.01
I believe this should work d - read.table(foo.csv, header=T, sep=,, comment=T) although its spitting back a warning... this used to work for me. Noah Silverman wrote Hi, I have a CSV file that is formatted well, except that the last line is a summary not is CSV format. Toy

[R] Reading in csv with footer

2012-02-12 Thread Noah Silverman
Hi, I have a CSV file that is formatted well, except that the last line is a summary not is CSV format. Toy example: label_1, label_2, label_3 1,2,3 3,2,4 2,3,4 Total Rows: 3 When I try to import this into R with: d - read.table(foo.csv, header=T, sep=,) It fails to import properly because

Re: [R] Reading in csv with footer

2012-02-12 Thread Steve Lianoglou
Hi, On Sun, Feb 12, 2012 at 7:05 PM, Noah Silverman noahsilver...@ucla.edu wrote: Hi, I have a CSV file that is formatted well, except that the last line is a summary not is CSV format. Toy example: label_1, label_2, label_3 1,2,3 3,2,4 2,3,4 Total Rows: 3 When I try to import this

Re: [R] Reading in csv with footer

2012-02-12 Thread Henrique Dallazuanna
This works for me: Lines - label_1, label_2, label_3 1,2,3 3,2,4 2,3,4 Total Rows: 3 d - head(read.csv(textConnection(Lines)), -1) closeAllConnections() On Sun, Feb 12, 2012 at 10:05 PM, Noah Silverman noahsilver...@ucla.eduwrote: Hi, I have a CSV file that is formatted well, except that

Re: [R] Reading in csv with footer

2012-02-12 Thread Noah Silverman
Thanks Steve, Your suggestion about nrows seems like the easiest. Thanks! -- Noah Silverman UCLA Department of Statistics 8208 Math Sciences Building Los Angeles, CA 90095 On Feb 12, 2012, at 4:23 PM, Steve Lianoglou wrote: Hi, On Sun, Feb 12, 2012 at 7:05 PM, Noah Silverman

Re: [R] Reading in csv with footer

2012-02-12 Thread Noah Silverman
Nice one!!! Tanks. -- Noah Silverman UCLA Department of Statistics 8208 Math Sciences Building Los Angeles, CA 90095 On Feb 12, 2012, at 4:26 PM, Henrique Dallazuanna wrote: This works for me: Lines - label_1, label_2, label_3 1,2,3 3,2,4 2,3,4 Total Rows: 3 d -

Re: [R] Reading in csv with footer

2012-02-12 Thread William Dunlap
Sent: Sunday, February 12, 2012 4:27 PM To: Noah Silverman Cc: r-help Subject: Re: [R] Reading in csv with footer This works for me: Lines - label_1, label_2, label_3 1,2,3 3,2,4 2,3,4 Total Rows: 3 d - head(read.csv(textConnection(Lines)), -1) closeAllConnections() On Sun, Feb

Re: [R] Reading in csv with footer

2012-02-12 Thread Rolf Turner
On 13/02/12 13:05, Noah Silverman wrote: Hi, I have a CSV file that is formatted well, except that the last line is a summary not is CSV format. Toy example: label_1, label_2, label_3 1,2,3 3,2,4 2,3,4 Total Rows: 3 When I try to import this into R with: d- read.table(foo.csv, header=T,