path.split {this.path}R Documentation

Split File Path Into Individual Components

Description

Split the path to a file into components in a platform-DEPENDENT way.

Usage

path.split(path)
path.split.1(path)
path.unsplit(...)

Arguments

path

character vector.

...

character vectors, or one list of character vectors.

Value

for path.split(), a list of character vectors.

for path.split.1() and path.unsplit(), a character vector.

Note

path.unsplit() is NOT the same as path.join().

Examples

path <- c(
    NA,
    "",
    paste0("https://raw.githubusercontent.com/ArcadeAntics/PACKAGES/",
           "src/contrib/Archive/this.path/this.path_1.0.0.tar.gz"),
    "//host/share/path/to/file",
    "//host/share/",
    "//host//share",
    "/path/to/file",
    "~/path/to/file",
    "path/to/file",
    ## paths with character encodings
    `Encoding<-`("path/to/fil\xe9", "latin1"),
    "/home/iris/Documents/\u03b4.R"
)
print(x <- path.split(path))
print(path.unsplit(x))

[Package this.path version 2.4.0 Index]