SEIR_to_SIR_E: Convert SEIR to XYZ coordinates fixed in a tetrahedron

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Convert SEIR to XYZ coordinates fixed in a tetrahedron

Usage

1
SEIR_to_SIR_E(data, ternary_vars = c("S", "I", "R"), group_var = "E")

Arguments

data

data frame with the following columns

t

time step

S

Number of people in S

E

Number of people in E

I

Number of people in I

R

Number of people in R

ternary_vars

named vector of the three variables to use as the sides of the ternary plot. Can be of the form c("t", "l", "r", "f") or c(t,l,r,f).

group_var

name of the variable to use as the color/feature/grouping vector. column name that is associated with the time step. Can either be a string or a promisary symbol

Value

data frame with the transformed variables SEIR -> s, i, r, group variables

Examples

1
2
3
4
5
6
7
seir <- data.frame(t = 0:3,
S = c(90, 80, 70, 60),
E = c(0, 10, 10, 10),
I = c(10, 10, 10, 10),
R = c(0, 0, 10, 20))
seir_xyz <- SEIR_to_XYZ(seir)
head(seir_xyz)

skgallagher/EpiCompare documentation built on Sept. 14, 2021, 5:45 a.m.