The filesstrings R package

filesstrings: An R Package for File and String Manipulation


filesstrings is an R package providing convenient functions for moving files, deleting directories, and a variety of string operations that facilitate manipulating file names and extracting information from strings. For example, R has no file.move(), just file.copy() and file.rename(), so the best way to move a file was to unintuitively rename it. filesstrings provides file.move(). The package’s string operations mostly pertain to dealing with numbers contained within strings. It has a function NiceFileNums() for fixing file names such that their numbering is consistent with alphabetical order. For example, ‘file10.txt’ comes before ‘file9.txt’ in alphabetical order, so NiceFileNums() recognises this and renames them to ‘file10.txt’ and ‘file09.txt’ respectively. See documentation at

In The Journal of Open Source Software.

filesstrings is available to download for free from CRAN and GitHub.