Setting the first row as column name in R
1
1
Entering edit mode
6.9 years ago
vinayjrao ▴ 250

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 • 15k views
ADD COMMENT
4
Entering edit mode
6.9 years ago
Satyajeet Khare ★ 1.6k

Add Argument header=TRUE

ADD COMMENT

Login before adding your answer.

Traffic: 1715 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6