I have the following code:
exp = list.files(pattern=glob2rx("*_input_*.txt))
int_file = lapply(exp, read.table, sep="\t", header = T)
and it returns like this:
exp
[1] "1_input_1.txt" "2_input_2.txt"
dim(int_file[[1])
[1] 2000 20
dim(int_file[[2]])
[1] 3000 20
type(int_file[[1]][1,1])
[1] "factor"
Here, the type of int_file is data frame and
the value of all columns in both two files is factor.
How I convert this factor into numeric?
I tried to run the code with 1) as.numeric(as.character(x)) 2) data.matrix(x) but, both of them did not work.