Skip to contents

Create tree children list by parents from a transition matrix.

Usage

transmat_to_child_list(transmat)

Arguments

transmat

Transition probability matrix. Rows are from nodes and columns are to nodes.

Value

list

Examples


transmat <-
  list(prob = matrix(data = c(NA, 0.5, 0.5), nrow = 1),
       vals = matrix(data = c(NA, 1, 2), nrow = 1)
       )
transmat_to_child_list(transmat$prob)
#> $`1`
#> [1] 2 3
#> 
#> $`2`
#> integer(0)
#> 
#> $`3`
#> integer(0)
#>