Hi All-- I used base R list.file function to read files from a directory. The file names are months (April, August, etc). That's the system reads them in alphabetical order., but i want to reordered them in calendar order (January, February, ...December).. I thought i might be able to do it via RegEx or possibly gtools package, I am wondering if there is an easier way.
Thanks--EK Example path = "C:/Users/name/Downloads/MyFiles" file.names <- dir(path, pattern =".PDF") Example output Output: "February.PDF" "January.PDF" "March.PDF" Desired output "January.PDF" "February.PDF" "March.PDF" ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.