Skip to contents

This function attempts to convert a pf or pfc object to a phylogenyin phylo format (from package {ape}). It will use the feature as branch lengths, and if edges have multiple feature values, they will be aggregated by averaging them. Note that this function can fail if the pf or pfc does not have a tree-like structure. An example of this would be an 'interaction' pfc (as generated by pf_interaction)

Usage

pf_as_phylo(x, ...)

Arguments

x

a pf or pfc object to be converted

...

Other arguments passed to or from other methods

Value

A phylo object

Examples

pf_as_phylo(rpfc(100))
#> 
#> Phylogenetic tree with 100 tips and 99 internal nodes.
#> 
#> Tip labels:
#>   t30, t31, t8, t5, t20, t46, ...
#> Node labels:
#>   root, Node2, Node11, Node48, Node54, Node59, ...
#> 
#> Rooted; includes branch lengths.