R
has a function to list files in a directory, which is list.files()
. It comes with the optional parameter pattern=
to list only files
I think that the simplest (and probably fastest if you include programmer time) approach is to run list.files
2 times, once to list all the files, then the second time with the pattern of files that you do not want, then use the setdiff
function to find those file names that are not in the group that you want to exclude.