resolvePath {tractor.base} | R Documentation |
Functions for file name and path manipulation
Description
Functions for expanding file paths, finding relative paths and ensuring that a file name has the required suffix.
Usage
resolvePath(path, ...)
relativePath(path, referencePath)
matchPaths(path, referencePath)
registerPathHandler(regex, handler)
expandFileName(fileName, base = getwd())
ensureFileSuffix(fileName, suffix, strip = NULL)
Arguments
path , referencePath |
Character vectors whose elements represent file paths (which may or may not currently exist). |
... |
Additional arguments to custom path handlers. |
regex |
A Ruby-style regular expression. |
handler |
A function taking and returning a string. |
fileName |
A character vector of file names. |
base |
If |
suffix |
A character vector of file suffixes, which will be recycled if
shorter than |
strip |
A character vector of suffixes to remove before appending
|
Details
The resolvePath
function passes its arguments elementwise through any
matching path handler, and returns the resolved paths. Nonmatching elements
are returned as-is. registerPathHandler
registers a new path handler
for special syntaxes, and is for advanced use only. relativePath
returns the specified path
, expressed relative to
referencePath
. matchPaths
resolves a vector of paths against a
vector of reference paths. expandFileName
returns the full path to
the specified file name, collapsing ".."
elements if appropriate.
ensureFileSuffix
returns the specified file names with the requested
suffixes appended (if they are not already).
Value
A character vector.
Author(s)
Jon Clayden
References
Please cite the following reference when using TractoR in your work:
J.D. Clayden, S. Muñoz Maniega, A.J. Storkey, M.D. King, M.E. Bastin & C.A. Clark (2011). TractoR: Magnetic resonance imaging and tractography with R. Journal of Statistical Software 44(8):1-18. doi:10.18637/jss.v044.i08.
See Also
normalizePath
does most of the work for
expandFileName
.