-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
74 lines (50 loc) · 2.07 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# lhmetools
<!-- badges: start -->
[![Travis build status](https://travis-ci.com/lhmet/lhmetools.svg?branch=master)](https://travis-ci.com/lhmet/lhmetools)
[![Codecov test coverage](https://codecov.io/gh/lhmet/lhmetools/branch/master/graph/badge.svg)](https://codecov.io/gh/lhmet/lhmetools?branch=master)
<!-- badges: end -->
The goal of **`{lhmetools}`** is to bundle all generic functions frequently used in LHMET.
## System requirements
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](https://www.7-zip.org/), a free software that can be easily installed from R using `installr::install.7zip()`.
```
install.packages("installr") # only for windows
install.7zip()
```
[^1]: It's developed by [RARLAB](https://www.rarlab.com/download.htm) and made
available in Linux and other Unix based operating systems.
## Installation
You can install **`{lhmetools}`** from [GitHub](https://github.com/) with:
```r
# install.packages("devtools")
devtools::install_github("lhmet/lhmetools")
```
## List of funcions
- `unrar()`: extract files from a `rar` 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:
```{r example, eval = FALSE}
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))
```