Updated: 2022-11-22
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.
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")
An example of how to use it is in a paper repo (soon to come)