normalizePath {utils} | R Documentation |
Convert file paths to canonical form for the platform, to display them in a user-understandable form.
normalizePath(path)
path |
character vector of file paths. |
Where the Unix-alike platform supports it this turns paths into absolute paths in their canonical form (no ./, ../ nor symbolic links).
On Windows it converts relative paths to absolute paths, and converts short names to long names. It will always use backslashes as the path separator.
A character vector.
If a path is not a real path the result is undefined. On Unix-alikes, this will likely be the corresponding input element. On Windows, a warning will be issued, and the result will be either the corresponding input element, or a transformation of it into an absolute path.
file_path_as_absolute
in package tools.
# random tempdir cat(normalizePath(c(R.home(), tempdir())), sep = "\n")