Learn R Programming

treespace (version 1.1.4.3)

findMRCIs: Find MRCIs

Description

Function to find the most recent common infector (MRCI) matrix from "who infected whom" information.

Usage

findMRCIs(wiw)

Value

Returns three objects:

  • sourceCase: the number of the node which is the source case, i.e. the common infector of all cases (outputs a warning if there is more than one source case).

  • mrcis: a matrix where, for each pair of individuals i and j, the entry (i,j) is the node number of their MRCI. Note that if i infected j then this entry is i itself.

  • mrciDepths: a matrix where, for each pair of individuals i and j, the entry (i,j) is the depth of their MRCI, defined as the number of edges from the source case. The source case has depth zero, its direct infectees have depth 1, and so on.

Arguments

wiw

a two-column matrix where the first column gives the infectors and the second column gives the infectees; each row corresponds to a transmission event from an infector to an infectee.

Author

Michelle Kendall michelle.louise.kendall@gmail.com

Examples

Run this code

## a simple who infected whom matrix:
tree1 <- cbind(Infector=1:5,Infectee=2:6) 
findMRCIs(tree1)


Run the code above in your browser using DataLab