-
Notifications
You must be signed in to change notification settings - Fork 0
/
forcis.Rmd
83 lines (55 loc) · 1.91 KB
/
forcis.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
71
72
73
74
75
76
77
78
79
80
81
82
83
---
title: "Get started"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Get started}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
eval = FALSE,
echo = TRUE,
comment = "#>"
)
```
> **NOTE:** THIS IS A WORK IN PROGRESS.
Add an good introduction of the package.
## Installation
To install the `forcis` package, run:
```{r 'installation', eval=FALSE}
## Install < remotes > package (if not already installed) ----
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}
## Install dev version of < forcis > from GitHub ----
remotes::install_github("FRBCesab/forcis")
```
The `forcis` package depends on the [`sf`](https://r-spatial.github.io/sf/) package which requires some spatial system libraries (GDAL and PROJ). Please read [this page](https://github.com/r-spatial/sf?tab=readme-ov-file#installing) if you have any trouble to install `forcis`.
## Setup
First, let's attach the required packages.
```{r setup}
library(forcis)
```
## Download FORCIS database
Before going any further, we will download the latest version of the FORCIS database.
```{r 'download-db', eval=FALSE}
# Create a data/ folder ----
dir.create("data")
# Download latest version of the database ----
download_forcis_db(path = "data", version = NULL)
```
## Import FORCIS data
The vignette will use the PUMP data of the FORCIS database. Let's import the latest release of the data.
```{r 'load-data', echo=FALSE}
file_name <- system.file(file.path("extdata", "FORCIS_pump_sample.csv"), package = "forcis")
pump_data <- vroom::vroom(file_name, delim = ";", show_col_types = FALSE)
```
```{r 'load-data-user', eval=FALSE}
# Import pump data ----
pump_data <- read_pump_data(path = "data")
```
**NB:** In this vignette, we use a subset of the PUMP data, not the whole dataset.
## Another section
[...]