Convert SEIR to XYZ coordinates fixed in a tetrahedron
SEIR_to_XYZ(data, var_order = c("S", "E", "I", "R"), time_name = "t")
data | data frame with the following columns
|
---|---|
var_order | vector of column names corresponding to the different axes
of the tetrahedron-based coordinate system: (t, l, r, f) which stands for
top, left, right, front. Can be of the form |
time_name | column name that is associated with the time step. Can either be a string or a promisary symbol |
original data frame along with columns x, y, and z
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)