The goal of {lhmetools}
is to bundle all generic functions
frequently used in LHMET.
To extract files from a rar
archive we have created the function
unrar()
. This function allows extract files using unrar
[1] tool
from the command line. unrar
tool can be installed using your Linux
distributions’ package manager.
$ sudo apt update && sudo apt install --assume-yes unrar # Ubuntu and Debian
Windows users should install the 7-zip, a free
software that can be easily installed from R using
installr::install.7zip()
.
install.packages("installr") # only for windows
install.7zip()
You can install {lhmetools}
from GitHub
with:
# install.packages("devtools")
devtools::install_github("lhmet/lhmetools")
-
unrar()
: extract files from arar
archive. -
complete_dates()
: complete missing data combinations leaving explicit missing dates. -
dates_from_files()
: parse dates from file names.
This is a basic example which shows you how to extract files:
library(lhmetools)
## basic example code
rarfile_url <- "https://ndownloader.figshare.com/files/13366451"
dest_file <- tempfile(fileext = ".rar")
download.file(rarfile_url, dest_file, mode = 'wb')
(extracted_files <- unrar(dest_file))
- It’s developed by RARLAB and made available in Linux and other Unix based operating systems.