convertPaths
is simply a wrapper around gsub
for changing the
first part of a path.
convertRasterPaths
is useful for changing the path to a file-backed
raster (e.g., after copying the file to a new location).
convertPaths(x, patterns, replacements)
convertRasterPaths(x, patterns, replacements)
For convertPaths
, a character vector of file paths.
For convertRasterPaths
, a disk-backed RasterLayer
object, or a list of such rasters.
Character vector containing a pattern to match (see ?gsub
).
Character vector of the same length of patterns
containing replacement text (see ?gsub
).
A normalized path with the patterns
replaced by replacements
. Or a list of such
objects if x
was a list.