Learn R Programming

seedy (version 1.3)

networkmat: Create adjacency matrix

Description

For a given set of infection routes, returns an adjacency matrix.

Usage

networkmat(ID, sources)

Arguments

ID
Vector of infective IDs
sources
Vector of infection sources corresponding to ID.

Value

  • Returns a matrix with the [i,j]th entry equal to 1 if the ith infective in ID infected the jth infective in ID.

See Also

ancestors

Examples

Run this code
data(outbreak)
networkmat(outbreak$epidata[,1], outbreak$epidata[,4])

Run the code above in your browser using DataLab