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:
#>   t75, t55, t89, t62, t28, t81, ...
#> Node labels:
#>   root, Node3, Node18, Node22, Node40, Node61, ...
#> 
#> Rooted; includes branch lengths.