Read.table: Skip Column
1
0
Entering edit mode
@herbert-meyer-10849
Last seen 8.4 years ago

Hallo,

I have this kind of data and want to skip the "tag" column:

analyt    tag    probe1    probe2   
a1         IS        12           16   
a2          I         23            25  
a3          I         12           221   

My code:

exprs <- as.matrix(read.table(exprsFile, header=TRUE, sep="\t",row.names=1, as.is=TRUE))

So I am looking for a read.table command, which allows me to skip the "tag" coloumn. I can find only commands to skip a row.

Thanks

 

read.table • 3.6k views
ADD COMMENT
1
Entering edit mode
@martin-morgan-1513
Last seen 3 months ago
United States

This is an R question so suitable for the r-help mailing list or StackOverflow or ?read.table. However, the answer is to use the colClasses argument, e.g.,

read.table(exprsFile, header=TRUE, sep="\t", row.names=1, as.is=TRUE,
    colClasses = c(tag="NULL"))
ADD COMMENT

Login before adding your answer.

Traffic: 758 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