Standardi[sz]e path names so that they can be more easily compared.
standardize_path(x = dir(), sep = c("/", "\\"), include_names = TRUE)standardise_path(x = dir(), sep = c("/", "\\"), include_names = TRUE)
- A character vector of file paths. Defaults to files in the current directory.
- String separator between directory levels in the output.
- A logical value indicating whether the output should be named with the input file paths.
providing additional tweaks to the output.
- Missing inputs always return
- Leading double back slashes are preserved under all OSes regardless of
the values of
- Leading double forward slashes are converted to double back slash under Windows (they are likely UNC paths), and a single forward slash under Unixes (they are likely absolute paths).
- Other back and forward slashes are replaced by
- Paths are always made absolute.
- Trailing slashes are always stripped, except for root (
"/") and Windows drives (
- Windows drives are always capitalized.
A character vector of paths, pointing to the same locations as the
input, but in a standardized form.
standardize_path(c(".", "..", "~", R.home(), NA)) standardize_path(c(".", "..", "~", R.home(), NA), "\\")
Looks like there are no examples yet.