View source: R/sequence-motifs.R
| summarise_sequence_motifs | R Documentation |
Aggregates extracted contiguous motif occurrences by sequence and overall.
summarise_sequence_motifs(x)
x |
An object returned by |
Sequence prevalence uses every validated sequence in the extraction object as its denominator, including sequences too short to contain a requested motif. Results are sorted deterministically by sequence prevalence, occurrence count, motif length, and motif key.
The function reports structural recurrence only. It does not perform significance testing or infer psychological, cognitive, emotional, or diagnostic attributes.
A named list containing:
by_sequence: occurrence counts for each sequence-motif pair;
overall: total occurrence counts, sequence counts, sequence prevalence,
occurrence share, and mean occurrence rates;
sequences and state_dictionary from extraction;
audit, status, mapping, and extraction settings;
scalar counts for sequences, occurrences, and distinct motifs.
sequences <- data.frame(
id = c(rep("s1", 5L), rep("s2", 4L)),
position = c(1:5, 1:4),
state = c("A", "B", "A", "B", "A", "A", "B", "A", "C")
)
extracted <- extract_sequence_ngrams(
sequences,
sequence_id_col = "id",
order_col = "position",
state_col = "state",
min_length = 2,
max_length = 3
)
summaries <- summarise_sequence_motifs(extracted)
summaries$by_sequence
summaries$overall
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.