On Jun 1, 2009, at 3:19 AM, Steven Matthew Anderson wrote:

I have a data.frame with three columns + the row number

       Sample MidPoint Count
  [1,]      1    0.025     1
  [2,]      1    0.075     3
  [3,]      1    0.125    15
  [4,]      1    0.175    12
  [5,]      1    0.225     5
  [6,]      1    0.275     8

When I export the data to a csv the column names are shifted because
the row numbers are being exported as well.

Sample  MidPoint        Count   
1       1       0.025   1
2       1       0.075   3
3       1       0.125   15

Is there a way to exclude the row numbers from the exported csv file?
Or add a column name for row number to keep this from happening?

?write.table

Try setting row.names=FALSE in the write.table call.

I obvisouly can go into each csv file and shift the column names over
- but there are going to be a large number of csv files so I with to
automate this.


        [[alternative HTML version deleted]]

And learn to send plain text to r-help.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@r-project.org 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.

Reply via email to