1

I have a file which looks like this..

"Locations" "X9442" "X5997"
"1" "cg00000957"    0.87    0.86
"2" "cg00001349"    0.78    0.78
"3" "cg00001583"    0.06    0.08
"4" "cg00002028"    0.01    0.01

I wish to remove the row names and make it look like as follows:

 "Locations"    "X9442" "X5997"
 "cg00000957"   0.87    0.86
 "cg00001349"   0.78    0.78
 "cg00001583"   0.06    0.08
 "cg00002028"   0.01    0.01

I tried various things, but I am not able to remove those indexes while doing write.table. Also sometimes the header "Locations" shifts its column. Can someone help me out how do I achieve the above in R or linux?

M--
  • 25,431
  • 8
  • 61
  • 93
Letin
  • 1,255
  • 5
  • 20
  • 36

1 Answers1

5

Look at the help file: ?write.table In particular,

write.table(dd, file="output.csv", row.names=FALSE)
csgillespie
  • 59,189
  • 14
  • 150
  • 185