View source: R/sequence-consensus-groups.R
| compare_sequence_groups | R Documentation |
Produces descriptive state, transition and sequence-length comparisons. No hypothesis tests or causal interpretations are produced.
compare_sequence_groups(
data,
group_col,
sequence_id_col = "sequence_id",
order_col = "sequence_order",
state_col = "state",
reference = NULL,
metrics = c("state", "transition", "length"),
include_self = TRUE,
transition_separator = " -> ",
zero_policy = c("missing", "infinite")
)
data |
Long-format sequence data. |
group_col |
Grouping column that is constant within sequence. |
sequence_id_col, order_col, state_col |
Sequence columns. |
reference |
Optional reference group. When supplied, each other
group is reported as |
metrics |
Any of |
include_self |
Include self-transitions. |
transition_separator |
Separator used in reported transition labels. It must not occur inside an observed state label. |
zero_policy |
Ratio policy when the reference value is zero. |
A list of class gp3_sequence_group_comparison containing group
summaries and pairwise descriptive contrasts.
sequences <- data.frame(
sequence_id = rep(c("s1", "s2", "s3", "s4"), each = 4L),
sequence_order = rep(1:4, times = 4L),
state = c("A", "B", "C", "D", "A", "B", "C", "C",
"D", "C", "B", "A", "D", "C", "A", "A"),
group = rep(c("g1", "g2"), each = 8L),
stringsAsFactors = FALSE
)
compare_sequence_groups(sequences, group_col = "group")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.