Hi everybody I am trying to solve a problem in R. I want to read a lot of files allocated in multiples sub folders in a main folder. Then I used list.files()
t
If this is the exact data that you have, you can sort it the way you want like this:
> b[order(as.integer(substr(b,2,3)))]
[1] "A1" "A2" "A3" "A4" "A5" "A6" "A7" "A8" "A9" "A10" "A11" "A12"
[13] "A13" "A14" "A15"
If the actual data is more complicated, you might have to do a little more string manipulation, but this is the general idea.