0

I have a .csv file with gene counts and sample names. I would like to be able to keep the two header rows. For example, I'd like to load a file in the format below:

       Sample
Gene    1        2
gene1   272.43    911.83
gene2   212.29    151.55
gene3   39.41      22.17

The ultimate goal is to plot sums of all gene counts by sample. Any ideas how to do this in R?

Thank you, tmd

akrun
  • 874,273
  • 37
  • 540
  • 662
tmd
  • 1
  • 1
  • You don't really have two header rows. The header is "Gene", 1, 2. You can rename it as "Gene", "Sample 1", "Sample 2" – sunny Jul 15 '15 at 19:24
  • 1
    Does [this](http://stackoverflow.com/questions/2293131/reading-in-files-with-two-header-rows) help? – ben_aaron Jul 15 '15 at 19:27
  • I simplified because it's a really large file with many, many samples that have long names. Is it possible to keep the two header rows so that I can easily plot? Or am I just thinking about this incorrectly? – tmd Jul 15 '15 at 19:27
  • It is not possible to do this out of the box. – Roman Luštrik Jul 15 '15 at 19:32
  • @ben_aaron, that just mashed the two headers together. Does anyone have suggestions on how to plot gene count matrices in R? – tmd Jul 15 '15 at 19:47

0 Answers0