I found a problem in which R seems to interpret "T"how TRUEeven using all means to not do this (at least according to this post).
Sample data (stored as "test.txt"):
col1 col2
1 T
2 T
3 T
4 T
5 T
6 T
7 T
8 T
9 T
Code example:
read.table("test.txt", as.is=TRUE, header=TRUE,
stringsAsFactors=FALSE, colClasses=c(character()))
It produces:
col1 col2
1 1 TRUE
2 2 TRUE
3 3 TRUE
4 4 TRUE
5 5 TRUE
6 6 TRUE
7 7 TRUE
8 8 TRUE
9 9 TRUE
The only imperfect solution I found was to set header = FALSE:
read.table("test.txt", as.is=TRUE, header=FALSE,
stringsAsFactors=FALSE,
colClasses=c(character()))
V1 V2
1 col1 col2
2 1 T
3 2 T
4 3 T
5 4 T
6 5 T
7 6 T
8 7 T
9 8 T
10 9 T
I understand that this may seem somewhat far-fetched, but this marginal case is genuine in that the human gene is actually named "T"(!) With values ββin col1that are positions inside this gene.
Thanks in advance for your help
Vince source
share