I have a few files which have a numbering system likes this:
chr001_genetic_file.txt
chr002_genetic_file.txt
...
chr022_genetic_file.txt
As well as another set like this:
genetic_files.001.european.txt
...
genetic_files.022.european.txt
I am trying to run a for loop: for(i in 001 to 022)
but R keeps throwing a naming error saying the file genetic_files.1.european.txt doesn't exist
.
I could rename all my files which seems like a headache in order to get "i in 1 to 22" to work. Is there a way around this?