splitext(character(0))
splitext("")
splitext("file.ext")
path <- c("file.tar.gz", "file.tar.bz2", "file.tar.xz")
splitext(path, compression = FALSE)
splitext(path, compression = TRUE)
path <- "this.path_2.5.0.tar.gz"
ext(path) <- ".png"
path
path <- "this.path_2.5.0.tar.gz"
ext(path, compression = TRUE) <- ".png"
path
Run the code above in your browser using DataLab