Skip to contents

Transition matrix to long format

Usage

transmat_to_long(probs)

Arguments

probs

Probability transition matrix

Value

array of from, to, prob

Examples


tree <- list(
   prob = matrix(data = c(NA, 0.5, 0.5), nrow = 1),
   vals = matrix(data = c(NA, 1, 2), nrow = 1))

transmat_to_long(tree$prob)
#> New names:
#>  `` -> `...1`
#>  `` -> `...2`
#>  `` -> `...3`
#>   from to prob
#> 2    1  2  0.5
#> 3    1  3  0.5