Converts an ancestor matrix to a tree in parent vector format

anc2parentVector(anc, n)

Arguments

anc

A matrix. An ancestor matrix.

n

A single integer. The number of mutations.

Value

a integer vector; parent vector format tree.

Examples

p = c(11, 2, 3, 14, 14, 16, 8, 6, 9, 1, 15, 8, 10, 14, 5, 13, 17)
anc <- parentVector2anc(parents=p,n = 16)
anc2parentVector(anc=anc,n=16)
#>  [1] 11  2  3 14 14 16  8  6  9  1 15  8 10 14  5 13