-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
80 lines (62 loc) · 2.6 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
71
72
73
74
75
76
77
78
79
80
---
title: "forcedlabor: forced labor model package"
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
Updated: `r Sys.Date()`
# Overview
`forcedlabor` is an R package containing functions to identify forced labor
on fishing vessels via a machine learning algorithm trained on a combination of
known forced labor cases and AIS data predictors.
# Installation
This R package is hosted on a private GitHub repository and can be installed
using the `devtools` package. Run the following code to check if you already
have `devtools` and install it if not.
``` r
# Check/install devtools
if (!require("devtools"))
install.packages("devtools")
```
To connect to GitHub, under the hood `devtools` calls the GitHub API. This means
that you’ll need to have a personal access token (PAT). Get a PAT
[here](https://github.com/settings/tokens) and make sure the “repo” scope is
included.
Save your PAT as an R environment variable (variables that should be available
to R processes) by running `usethis::edit_r_environ()`, adding `GITHUB_PAT =
"your PAT"`, and saving the updated `.Renviron` file. You might need to restart
the R session.
Finally, after saving your GitHub PAT to your R environment, install the
`forcedlabor` package using `devtools`.
```{r eval = FALSE}
# Install fishwatchr
devtools::install_github("GlobalFishingWatch/forcedlabor")
```
# Using the package
An example of how to use it is in a paper repo (soon to come)
# Structure of the repository
* **R:** R functions of the package
* **man:** Standard documentation files for R functions
* **renv:** Contains files to activate the R environment with specific
settings
* **.Rbuildignore** Contains names of files that should be ignored to build
the R package
* **.Rprofile** Used in the R session to get the R environment of this
package
* **.gitignore** Files to ignore by version control.
* **.pre-commit-config.yaml** Style linting using `pre-commit library.
* **DESCRIPTION** It stores the metadata of the package
* **NAMESPACE** It contains information of important names in the package
to provide space for them and make the package self
contained
* **README.md** Top-level README on how to use this repo
* **README.Rmd** Rmarkdown file that generates README.md
* **forcedlabor.Rproj** Rproj file
* **renv.lock** It contains the information on the packages used in the
project.