GlobalFishingWatch / forcedlabor

forcedlabor: forced labor model package
GNU General Public License v3.0
0 stars 0 forks source link

forcedlabor: forced labor model package

Updated: 2022-11-22

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.

# 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 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.

# 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