Skip to contents

The state-to-state weight matrix behind a ts_tna()-family model: transition probabilities for ts_tna(), counts for ts_ftna(), and so on. Without this method as.matrix() falls through to the default, which coerces the object's component list rather than its network.

Usage

# S3 method for class 'ts_tna'
as.matrix(x, rownames.force = NA, ...)

Arguments

x

A ts_tna result.

rownames.force

Ignored.

...

Ignored.

Value

A named numeric matrix, states in row and column order.

Examples

set.seed(1)
network <- ts_tna(cumsum(rnorm(60)), labels = c("low", "mid", "high"))
as.matrix(network)
#>       low       mid      high
#> low  0.80 0.2000000 0.0000000
#> mid  0.15 0.5500000 0.3000000
#> high 0.00 0.2631579 0.7368421