findPrefix {PBSmodelling} | R Documentation |
Find the prefixes or suffixes of files with a given suffix or prefix in a directory.
findPrefix(suffix,path=".") findSuffix(prefix,path=".")
suffix |
character vector of suffixes |
prefix |
character vector of prefixes |
path |
directory to look for files in |
The function findPrefix
locates all files in a directory that end with
one of the provided suffixes; where as findSuffix
locates all files
that start with the given prefixes.
A character vector of all the prefixes or sufixes of files in the working directory that matched to one of the given suffixes.
Anisa Egeli, Vancouver Island University, Nanaimo BC
#TODO give better examples from the library's example dir findPrefix( c(".txt", ".r") ) #or use R's dir for similar functionality dir(pattern="\.txt$") dir(pattern="$prefix")