Question: Setting the first row as column name in R
1
gravatar for vinayjrao
2.9 years ago by
vinayjrao180
inStem, India
vinayjrao180 wrote:

Hello,

I have a file -

GeneID sample1 sample2 sample3 sample4 gene_length

gene1   count1     count2   count3    count4    length1

gene2   count1     count2   count3    count4    length2

gene3   count1     count2   count3    count4    length3

gene4   count1     count2   count3    count4    length4

When imported to R using read.table() I get columns assigned by default as V1, V2, V3 etc, but how can I set the first row as the column names?

GeneID sample1 sample2 sample3 sample4 gene_length

Thanks.

R • 12k views
ADD COMMENTlink modified 2.9 years ago by Satyajeet Khare1.6k • written 2.9 years ago by vinayjrao180
4
gravatar for Satyajeet Khare
2.9 years ago by
Satyajeet Khare1.6k
Pune, India
Satyajeet Khare1.6k wrote:

Add Argument header=TRUE

ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by Satyajeet Khare1.6k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1894 users visited in the last hour