Description Usage Arguments Value Author(s) See Also Examples
This function has more capabilities than path.expand
, in that relative
paths (. and ./ and ../ and implicit ./) are also expanded, and more than normalizePath
, in that
files with an implicit ./ are also expanded relative to the current working dir,
and files that don't currently exist can also expanded (see examples).
1 | get.full.path(path, trailing.slash = TRUE)
|
path |
A character vector of paths to files or directories |
trailing.slash |
logical. if TRUE, and path is a directory, include a trailing “/” |
A character vector containing the full paths to files or directories given by “file”
Mark Cowley
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
path.expand("~")
normalizePath("~")
get.full.path("~", trailing.slash=FALSE)
get.full.path("~", trailing.slash=TRUE)
path.expand("./")
normalizePath("./")
get.full.path("./")
path.expand("../")
normalizePath("../")
get.full.path("..")
#
# benefits over other approaches
# - file doesn't have to exist already
get.full.path("sgsdf.zip")
# [1] "/Users/marcow/src/R/mjcbase/R/sgsdf.zip"
path.expand("sgsdf.zip")
# [1] "sgsdf.zip"
normalizePath("sgsdf.zip")
# [1] "sgsdf.zip"
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.