Entering edit mode
7.4 years ago
niutster
▴
110
Hi, I have read a text file by read.delim("Chr.txt), Chr file contains numbers but when i want to get a number and compare , i dont get correct answer:
my_data <- read.delim("Chr.txt")
> my_data[1,1]
[1] 2
Levels: 1 10 11 12 13 14 15 16 17 18 19 2 20 21 22 3 4 5 6 7 8 9 X Y
> my_data[1,1] <3
[1] NA
Warning message:
In Ops.factor(my_data[1, 1], 3) : ‘<’ not meaningful for factors
It does not work correctly.
I can reproduce the problem in your original question but not the one here in the comment: