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.35──→ Node2 ── 0.46──→ Node4 ── 0.74──→ Node7 ── 0.84──→ Node13 ── 0.89──→ Node23 ── 0.94──→ Node86 ── 0.95──→ t67 
#> 
#> [2] ◎── 0.35──→ Node2 ── 0.46──→ Node4 ── 0.74──→ Node7 ── 0.84──→ Node13 ── 0.89──→ Node23 ── 0.94──→ Node86 ── 0.95──→ Node97 ── 0.95──→ t34 
#> 
#> [3] ◎── 0.35──→ Node2 ── 0.46──→ Node4 ── 0.74──→ Node7 ── 0.84──→ Node13 ── 0.89──→ Node23 ── 0.94──→ Node86 ── 0.95──→ Node97 ── 0.95──→ t76 
#> 
#> [4] ◎── 0.35──→ Node2 ── 0.46──→ Node4 ── 0.74──→ Node7 ── 0.84──→ Node13 ── 0.89──→ Node23 ── 0.89──→ Node27 ── 0.92──→ Node45 ── 0.94──→ Node78 ── 0.95──→ t45 
#> 
#> [5] ◎── 0.35──→ Node2 ── 0.46──→ Node4 ── 0.74──→ Node7 ── 0.84──→ Node13 ── 0.89──→ Node23 ── 0.89──→ Node27 ── 0.92──→ Node45 ── 0.94──→ Node78 ── 0.95──→ t42 
#> 
#> [6] ◎── 0.35──→ Node2 ── 0.46──→ Node4 ── 0.74──→ Node7 ── 0.84──→ Node13 ── 0.89──→ Node23 ── 0.89──→ Node27 ── 0.92──→ Node45 ── 0.95──→ t6 
#> 
#> [7] ◎── 0.35──→ Node2 ── 0.46──→ Node4 ── 0.74──→ Node7 ── 0.84──→ Node13 ── 0.89──→ Node23 ── 0.89──→ Node27 ── 0.93──→ Node57 ── 0.94──→ Node76 ── 0.95──→ t37 
#> 
#> [8] ◎── 0.35──→ Node2 ── 0.46──→ Node4 ── 0.74──→ Node7 ── 0.84──→ Node13 ── 0.89──→ Node23 ── 0.89──→ Node27 ── 0.93──→ Node57 ── 0.94──→ Node76 ── 0.95──→ t20 
#> 
#> [9] ◎── 0.35──→ Node2 ── 0.46──→ Node4 ── 0.74──→ Node7 ── 0.84──→ Node13 ── 0.89──→ Node23 ── 0.89──→ Node27 ── 0.93──→ Node57 ── 0.93──→ Node60 ── 0.95──→ t10 
#> 
#> [10] ◎── 0.35──→ Node2 ── 0.46──→ Node4 ── 0.74──→ Node7 ── 0.84──→ Node13 ── 0.89──→ Node23 ── 0.89──→ Node27 ── 0.93──→ Node57 ── 0.93──→ Node60 ── 0.95──→ Node99 ── 0.95──→ t65