EnviroDataR is an R client for interacting with the EnviroData API.
To install EnviroDataR from the Hatfield Gitlab onto your local R library, you’ll need to first set your personal access token (PAT) if you’ve not already done so.
Instructions for generating a Gitlab Personal Access Token can be found here: https://git.hatfieldgroup.net/snippets/8#note_12424
Once you have your PAT, you can use the remotes package to install the EnviroDataR. Enter the code below into your R console:
# example function call to install a package from GitLab
::install_gitlab("hatfield/wrdr@edr_prep",
remoteshost="https://git.hatfieldgroup.net",
INSTALL_opts = c("--no-multiarch"),
auth_token = [PASTE YOUR TOKEN HERE INSIDE OF QUOTES AND WITHOUT SQUARE BRACKETS])
That’s it! You’re done!
One more thing. You may want to set your PAT as an environment variable for future use. Here’s how:
# set GitLab PAT, where [TOKEN] is the GitLab PAT
Sys.setenv(GITLAB_PAT='[TOKEN]')
library(EnviroDataR)
See the Get Started page for a 5 minute tutorial on the basics of EnviroDataR.
Stub functions for testing each of the main functions can be found in /draft_vignettes/sometests.R. Keep the file here as it tends to cause problems during package building otherwise.
envirodata_service_functions are specifically used by microservices, but obviously work outside of that context as well.