[R] Reading in csv with footer

Noah Silverman noahsilverman at ucla.edu
Mon Feb 13 01:05:09 CET 2012


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
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 of the last line.

Currently, I have a shell script that strips the last line from the file, then it imports to R cleanly.  I don't like this extra layer of processing.

Is there a way to import something like this cleanly in R.



More information about the R-help mailing list