I'd like to the convert the values in the first column into row names.
There are some similar questions about it like this
Convert the values in a column into row names in an existing data frame in R
However, the thing is that I would like to do that in the files with listed up.
What should I do to apply into multiple files (ex. int_file[[i]]
)?
> exp = list.files(pattern=glob2rx("*_input_*.txt"))
> int_file = lapply(exp, read.table, sep="\t", header = T)
# I tried with int_files=lapply(exp, red.table. sep="\t", row.names=NULL)
> 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"
for ( i in 1:length(int_file){do stuff.. int_file[[i]]} – user2913161 Nov 22 '13 at 23:52