R script now takes list of filenames