translinks: Calculate tree distance

Description Usage Arguments Details Examples

View source: R/simulatedata.r

Description

Compute the number of transmission links separating two nodes in a transmission tree.

Usage

1
translinks(p1, p2, patID, psource)

Arguments

p1

Patient ID 1.

p2

Patient ID 2.

patID

Vector of patient IDs.

psource

Vector of transmission sources corresponding to patID.

Details

Returns the number of transmission links separating two patients in the transmission tree. If patients belong to unconnected transmission trees, -1 is returned. Directions of transmission links are disregarded.

Examples

1
2
3
4
5
data(hospitaldata)
# Patients 48 and 58 are 3 links apart
translinks(48,58,hospitaldata$epi[,1],hospitaldata$epi[,5])
# Patients 89 and 58 are in separate transmission chains
translinks(89,58,hospitaldata$epi[,1],hospitaldata$epi[,5])

bitrugs documentation built on May 29, 2017, 11:06 p.m.

Search within the bitrugs package
Search all R packages, documentation and source code