Convert the newick format tree to a parent vector format

nwk2parentVector(nwk, n)

Arguments

nwk

the string of newick format tree.

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)
nwk = parentVector2nwk(parents=p,n = 16)
nwk2parentVector(nwk,n=16)
#>  [1] 11  2  3 14 14 16  8  6  9  1 15  8 10 14  5 13