The goal of nitratesgame is to provide a simple framework for analyzing a game theoretic model of community nitrate contamination. It offers two main tools for analysis:
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("gopalpenny/nitratesgame")
The website for nitratesgame
can be found on github.io.
This is a basic example which shows you how to visualize a 2x2 game:
library(nitratesgame)
# tA: player type A
# tB: player type B
# Cs: cost of upgrading septic system
# Cd: cost of contamination
payouts <- get_2x2_payouts(tA = 1, tB = 1, Cs = 2, Cd = 3)
get_2x2_ggplot(payouts, TRUE)