Skip to contents

Converts relationship graph to an igraph object

Usage

RG_to_igraph(RG, gs, ts_per_gs)

Arguments

RG

Relationship graph output by enumerate_RGs with igraph=FALSE.

gs

Vector of genotype names.

ts_per_gs

Vector of infection numbers for each genotype. This can be inferred from the data y using rep(1:length(y), determine_MOIs(y)).

Value

An igraph object along with the original variables in RG.

Examples

set.seed(20)
RG <- sample_RG(c(2, 2))
RG <- RG_to_igraph(RG, c("g1", "g2", "g3", "g4"), c(1, 1, 2, 2))