README.md

SpARKjags

test-build codecov CodeFactor

Table of contents

General info

This package contains JAGS models and associated functionality for use with SpARK project data.

Setup

To install this package in R, run:

install.packages("devtools")
devtools::install_github("soniamitchell/SpARKjags")

Note that you must have access to the SpARK project datasets for any of this code to work.

How to

List all of the models included in the SpARKjags package

list_models()

Run one of the SpARKjags models

# Generate JAGS input dataset
data <- jags_data(classification = "Carbapenem",
                  categories = "human",
                  pathogen = "Klebsiella pneumoniae",
                  removeQuinPen = T)

# Run the model                  
path <- run_SpARKjags_model(data = data,
                            SpARKjags_model = "individual_models/h.R",
                            save_to = "results/individual_models")

The run_SpARKjags_model() function will return the path of the model output.

Read model output into R

results <- get_model(path = path)


soniamitchell/SpARKjags documentation built on May 5, 2022, 12:09 p.m.