Skip to contents

Cumulative sum the phylogenetic flow features for each flow in a pfc, returning a pfc.

Usage

pf_flow_cumsum(x, direction = c("from_root", "to_root"), ...)

Arguments

x

A pfc object

direction

Which direction to take the cumulative sum along? "from_root", the default, goes from the root to the terminal nodes. "to_root" goes in the opposite direction, from the terminal nodes to the root.

...

Other arguments to pass to or from other methods

Value

A pfc object with cumulative sums of features in place of the original features

Examples

pf_flow_cumsum(rpfc(100))
#> <pfc<e:198>[198]>
#> First  10 phylogenetic flows: 
#> [1] ◎── 0.84──→ Node19 ── 0.85──→ Node21 ── 0.92──→ Node84 ── 0.92──→ t23 
#> 
#> [2] ◎── 0.84──→ Node19 ── 0.85──→ Node21 ── 0.92──→ Node84 ── 0.92──→ t54 
#> 
#> [3] ◎── 0.84──→ Node19 ── 0.85──→ Node21 ── 0.85──→ Node24 ── 0.86──→ Node26 ── 0.90──→ Node41 ── 0.92──→ t79 
#> 
#> [4] ◎── 0.84──→ Node19 ── 0.85──→ Node21 ── 0.85──→ Node24 ── 0.86──→ Node26 ── 0.90──→ Node41 ── 0.92──→ Node95 ── 0.92──→ t26 
#> 
#> [5] ◎── 0.84──→ Node19 ── 0.85──→ Node21 ── 0.85──→ Node24 ── 0.86──→ Node26 ── 0.90──→ Node41 ── 0.92──→ Node95 ── 0.92──→ t22 
#> 
#> [6] ◎── 0.84──→ Node19 ── 0.85──→ Node21 ── 0.85──→ Node24 ── 0.86──→ Node26 ── 0.92──→ t5 
#> 
#> [7] ◎── 0.84──→ Node19 ── 0.85──→ Node21 ── 0.85──→ Node24 ── 0.91──→ Node62 ── 0.92──→ Node97 ── 0.92──→ t43 
#> 
#> [8] ◎── 0.84──→ Node19 ── 0.85──→ Node21 ── 0.85──→ Node24 ── 0.91──→ Node62 ── 0.92──→ Node97 ── 0.92──→ t81 
#> 
#> [9] ◎── 0.84──→ Node19 ── 0.85──→ Node21 ── 0.85──→ Node24 ── 0.91──→ Node62 ── 0.92──→ t9 
#> 
#> [10] ◎── 0.84──→ Node19 ── 0.92──→ Node99 ── 0.92──→ t18