Possible Duplicate:
Convert factor to integer in a data frame
I have the following code
anna.table<-data.frame (anna1,anna2)
write.table<-(anna.table, file="anna.file.txt",sep='\t', quote=FALSE)
my table in the end contains numbers such as the following
chr start end score
2 123 322 1,21E+07
. . . .
. . . .
. . . .
. . . .
. . . .
and so on......
after that I am trying to to get only the values which fit some criteria such as score less than a specific value
so I am doing the following
anna2<-"data/anna/anna.file.txt"
anna.total<-read.table(anna2,header=TRUE)
significant.anna<-subset(anna.total,score <=0.001)
Error: In Ops.factor(score, 0.001) <= not meaningful for factors
so I guess the problem is that my table has factors and not integers
I guess that my anna.total$score is a factor and i must make it an integer
If I read correctly the as.numeric might solve my problem
I am reading about the as.numeric function but I cannot understand how I can use it
Hence could you please give me some advices?