NOTE: This repository contains functions for SABRENet involving Airtable. However, data was removed from Airtable on May 3, 2024. Thus, while some of these functions could be useful as templates for other work, a decent portion of this code is defunct for SABRENet
This respoitory contains code associated with the SABRENet project in collaboration with the University of Pretoria, South Africa. This repository is an offshoot of code originally found in sabrenet-reports that has now become a package for use in other sabrenet-XXXX repositories. This package/repository contains useful code for functions that are used across sabrenet-XXXX repositories
devtools::install_github("ecohealthalliance/sabrenetfunctions")
The base is currently maintained by Morgan Kain and Collin Schwantes
Repository Structure and Reproducibility (across all sabrenet-XXXX repositories, some may not show up in -this- repo)
data/
contains data from the study and a data dictionary describing all variables.auth/
contains creds for google service account. Click here for more infoR/
contains functions used in this analysis.reports/
contains literate code for R Markdown reports generated in the analysisoutputs/
contains compiled reports and figures.
Function and R/ naming conventions (across all sabrenet-XXXX repositories, some may not show up in -this- repo)
- First level function prefixes:
- get_ –> retrieving data from Airtable base
- mostly associated with
data_input_targets
- mostly associated with
- insert_ –> Adding new rows to airtable tables with local data
- mostly associated with
data_insert_targets
- mostly associated with
- modify_ –> modifying entries in existing rows in airtable tables
with local data
- mostly associated with
data_insert_targets
- mostly associated with
- process_ , establish_ , clean_ , summarize_ –> all data
manipulation/cleaning for insert_ , plot_ , or generate_
- mostly part of
data_organization_targets
- mostly part of
- calculate_ , estimate_ –> Analyses
analysis_targets
- generate_ , plot_ , render_ –> creation of any saved output
table_targets
,plot_targets
- get_ –> retrieving data from Airtable base
- Second stage prefixes (analysis classes)
- PCR – pipeline associated with molecular analysis of samples
- sero – pipeline associated with serology
- GPS – any spatial stuff
- diversity – estiamtes of viral diversity
- Unlike other sabrenet-XXXX repositories this repository does not use
the
targets
package because it just houses some functions that are meant to be sourced from within the other repositories
- This project requires R version 4.3.2 (2023-10-31). This project uses
the {renv} framework to record R
package dependencies and versions. Packages and versions used are
recorded in
renv.lock
and code used to manage dependencies is inrenv/
and other files in the root project directory. On starting an R session in the working directory, runrenv::restore()
to install R package dependencies.