In a transmission tree, every node is identified as one of its descendants, the person who transmitted the disease to the other descendants of the node. The function provides one (out of many possible) such identification, assuming that each of the direct descendants of the node is equally likely to be the node itself.

sampleNodeIds(tree)

Arguments

tree

a phylo object with N tips

Value

an integer vector of length the number of nodes (including tips) in the tree and elements in 1:N, the identities of all nodes in the tree (including the tips at positions 1:N)