resolvePath | R Documentation |
Functions for expanding file paths, finding relative paths and ensuring that a file name has the required suffix.
resolvePath(path, ...)
relativePath(path, referencePath)
matchPaths(path, referencePath)
registerPathHandler(regex, handler)
expandFileName(fileName, base = getwd())
ensureFileSuffix(fileName, suffix, strip = NULL)
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
|
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).
A character vector.
Jon Clayden
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v044.i08")}.
normalizePath
does most of the work for
expandFileName
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.