| as.data.frame.simulab_tna | R Documentation |
Tidy tables of a simulated transition network
## S3 method for class 'simulab_tna'
as.data.frame(x, row.names = NULL, optional = FALSE, what = "edges", ...)
x |
A |
row.names, optional |
Ignored; present for the generic. |
what |
Table to return: |
... |
Ignored. |
A base data.frame. "edges" has one row per edge with columns
from, to and weight; "transitions" one row per edge with columns
from, to and probability; "initial_probabilities" one row per
state with columns state and probability; "sequences" one row per
sequence and position with columns id, period and state.
if (requireNamespace("tna", quietly = TRUE)) {
network <- simulate_tna(n = 30, n_states = 3, seed = 1)
as.data.frame(network)
as.data.frame(network, what = "transitions")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.