Skip to contents

Return a pfc with ancestral features

Usage

pf_anc(x, replace = 0)

Arguments

x

A pfc object

replace

Value to replace edge feature with no ancestral value (such as when the ancestor is the root)

Value

A new pfc with the same structure as x, but with the features of each edge's ancestor instead

Examples

pf_anc(rpfc(100))
#> <pfc<e:198>[198]>
#> First  10 phylogenetic flows: 
#> [1] ◎──0.000──→ Node2 ──1.626──→ Node4 ──0.551──→ Node6 ──0.037──→ Node7 ──0.033──→ Node12 ──0.092──→ Node36 ──0.155──→ t58 
#> 
#> [2] ◎──0.00000──→ Node2 ──1.62622──→ Node4 ──0.55130──→ Node6 ──0.03736──→ Node7 ──0.03277──→ Node12 ──0.09206──→ Node36 ──0.15526──→ Node42 ──0.00544──→ Node44 ──0.00197──→ Node62 ──0.01356──→ Node63 ──0.00018──→ Node68 ──0.00334──→ t93 
#> 
#> [3] ◎──0.00000──→ Node2 ──1.62622──→ Node4 ──0.55130──→ Node6 ──0.03736──→ Node7 ──0.03277──→ Node12 ──0.09206──→ Node36 ──0.15526──→ Node42 ──0.00544──→ Node44 ──0.00197──→ Node62 ──0.01356──→ Node63 ──0.00018──→ Node68 ──0.00334──→ t65 
#> 
#> [4] ◎──0.00000──→ Node2 ──1.62622──→ Node4 ──0.55130──→ Node6 ──0.03736──→ Node7 ──0.03277──→ Node12 ──0.09206──→ Node36 ──0.15526──→ Node42 ──0.00544──→ Node44 ──0.00197──→ Node62 ──0.01356──→ Node63 ──0.00018──→ t45 
#> 
#> [5] ◎──0.0000──→ Node2 ──1.6262──→ Node4 ──0.5513──→ Node6 ──0.0374──→ Node7 ──0.0328──→ Node12 ──0.0921──→ Node36 ──0.1553──→ Node42 ──0.0054──→ Node44 ──0.0020──→ Node62 ──0.0136──→ t3 
#> 
#> [6] ◎──0.0000──→ Node2 ──1.6262──→ Node4 ──0.5513──→ Node6 ──0.0374──→ Node7 ──0.0328──→ Node12 ──0.0921──→ Node36 ──0.1553──→ Node42 ──0.0054──→ Node44 ──0.0020──→ t56 
#> 
#> [7] ◎──0.0000──→ Node2 ──1.6262──→ Node4 ──0.5513──→ Node6 ──0.0374──→ Node7 ──0.0328──→ Node12 ──0.0921──→ Node36 ──0.1553──→ Node42 ──0.0054──→ t19 
#> 
#> [8] ◎──0.000──→ Node2 ──1.626──→ Node4 ──0.551──→ Node6 ──0.037──→ Node7 ──0.033──→ Node12 ──0.092──→ Node24 ──0.120──→ Node80 ──0.064──→ t1 
#> 
#> [9] ◎──0.0000──→ Node2 ──1.6262──→ Node4 ──0.5513──→ Node6 ──0.0374──→ Node7 ──0.0328──→ Node12 ──0.0921──→ Node24 ──0.1195──→ Node80 ──0.0642──→ Node88 ──0.0024──→ t9 
#> 
#> [10] ◎──0.00000──→ Node2 ──1.62622──→ Node4 ──0.55130──→ Node6 ──0.03736──→ Node7 ──0.03277──→ Node12 ──0.09206──→ Node24 ──0.11953──→ Node80 ──0.06418──→ Node88 ──0.00242──→ Node99 ──0.00097──→ t67