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",
"C:\\path\\to\\file",
"C:path\\to\\file",
"path\\to\\file",
"\\path\\to\\file",
"~\\path\\to\\file",
## paths with character encodings
`Encoding<-`("path/to/fil\xe9", "latin1"),
"C:/Users/iris/Documents/\u03b4.R"
)
print(x <- path.split(path))
print(path.unsplit(x))
Run the code above in your browser using DataLab