unrar | R Documentation |
rar
archives (only works on Linux)This function extract files from a .rar
file
unrar(
file,
dest_dir = fs::path_ext_remove(file),
overwrite = FALSE,
quiet = TRUE
)
file |
a file path to a |
dest_dir |
path to extract files. Defaults to |
overwrite |
logical, use |
quiet |
Hide printed output, messages, warnings, and errors (TRUE, the default), or display them as they occur? |
This function has the side effect of extract files in a
directory named (dest_dir/basename(file)
) when dest_dir
is not NULL
.
character vector with files path
This function is a wrapper to call unrar
command. It is required you
have unrar
Linux library installed. You can install it with
apt install unrar
.
## Not run:
if (interactive()) {
rarfile_url <- paste0("https://www.dropbox.com/scl/fi/63eimy6j2ok1q3vf11zs4/",
"some-file.rar?rlkey=jhveob9ysl1ivy3alnt68c61g&st=dvt43nb1&dl=1")
dest_file <- file.path(tempdir(), strsplit(basename(rarfile_url), "\\?")[[1]][[1]])
#dest_file <- tempfile(fileext = ".rar")
download.file(rarfile_url, dest_file, mode = "wb")
extracted_files <- unrar(dest_file)
extracted_files
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.