The goal of PATHtoolsZambia is to contain reproducible code for processing and cleaning data for malaria-related work in Zambia, and provide easy access to up-to-date versions of those resources.

Installation

Github authentication

In order to install the package, first we need RStudio to have access to your Github authentication. The easiest way to do this is with the usethis package.

# Install the usethis package if needed
install.packages("usethis")

# Get or generate your Github personal access token (PAT)
usethis::browse_github_pat()

# Copy your PAT, then add it to your .Renviron file:
usethis::edit_r_environ()

Your .Renviron file should have a line similar to the line below. Save the file, then restart your R session (Ctrl + Shift + F10).

GITHUB_PAT="ghp_CM**********************************"

Install from Github

You can install this package from GitHub with:

# Install the devtools package if needed
install.packages("devtools")

# Use the devtools package to install package from Github
devtools::install_github("PATH-Global-Health/PATHtoolsZambia")

Access files with retrieve()

The retrieve() function will load the most recent version of the cleaned data files.

library(PATHtoolsZambia)

# List available datasets
list_data()

# Load health facility data with catchment population estimates
retrieve("hfca-pop-table")