[R] write.csv writing the "index"

rkevinburton at charter.net rkevinburton at charter.net
Fri Aug 8 20:23:10 CEST 2008


I have a simple command to export a data.frame:

write.csv(output, "TotalPredicted2008.dat")

The structure of the data.frame can be seen with:

> head(output)
  DayOfYear Sales
1         1  1429
2         2  3952
3         3  3049
4         4  2844
5         5  2219
6         6  2340

But it seems that the index is getting written out to the file. The first few lines look like:

"","DayOfYear","Sales"
"1",1,1429
"2",2,3952
"3",3,3049
"4",4,2844
"5",5,2219
"6",6,2340

I would like to not have this extra column in the output. Can it be filtered out?

Thank you.

Kevin



More information about the R-help mailing list