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.
Returns
A character vector of all the prefixes or sufixes of files in the working directory that matched to one of the given suffixes.
Author(s)
Anisa Egeli, Vancouver Island University, Nanaimo BC
Examples
local(envir=.PBSmodEnv,expr={ edir = system.file("examples", package="PBSmodelling") print(findPrefix(suffix=c(".txt",".r"),path=edir)); cat("\n")#or use R's dir for similar functionality print(dir(pattern="txt$",path=edir)); cat("\n") print(dir(pattern="^[a-h]",path=edir)); cat("\n")})