phylo
to multiPhylo
inputR/metrics.R
refTreeDist.Rd
Comparison of a single reference tree to a list of trees using the Kendall Colijn metric. Output is given as a vector of distances from the reference tree.
refTreeDist(
refTree,
trees,
lambda = 0,
return.lambda.function = FALSE,
emphasise.tips = NULL,
emphasise.weight = 2
)
a tree of class phylo
, the "reference tree".
an object of the class multiPhylo
containing the trees to be compared to the reference tree
a number in [0,1] which specifies the extent to which topology (default, with lambda=0) or branch lengths (lambda=1) are emphasised. This argument is ignored if return.lambda.function=TRUE
.
If true, a function that can be invoked with different lambda values is returned. This function returns the vector of metric values for the given lambda.
an optional list of tips whose entries in the tree vectors should be emphasised. Defaults to NULL
.
applicable only if a list is supplied to emphasise.tips
, this value (default 2) is the number by which vector entries corresponding to those tips are emphasised.
The vector of distances, where entry i corresponds to the distance between the i'th tree and the reference tree, or a function that produces the vector of distances given a value for lambda.
## generate a single reference tree with 6 tips
refTree <- rtree(6)
## generate 10 random trees, each with 6 tips
trees <- rmtree(10,6)
## find the distances from each of the 10 random trees to the single reference tree
refTreeDist(refTree,trees)
#> [1] 6.403124 4.358899 3.872983 6.082763 6.855655 6.557439 6.244998 5.744563
#> [9] 6.324555 6.082763