View source: R/multi-state-helpers.R
add_counterfactual_transitions | R Documentation |
If data only contains one row per transition that took place, this function adds additional rows for each transition that was possible at that time (for each subject in the data).
add_counterfactual_transitions(
data,
from_to_pairs = list(),
from_col = "from",
to_col = "to",
transition_col = "transition"
)
data |
Data set that only contains rows for transitions that took place. |
from_to_pairs |
A list with one element for each possible initial state. The values of each list element indicate possible transitions from that state. Will be calculated from the data if unspecified. |
from_col |
Name of the column that stores initial state. |
to_col |
Name of the column that stores end state. |
transition_col |
Name of the column that contains the transition identifier (factor variable). |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.