get_cluster_sequences {MSCA} | R Documentation |
Extract sequences of length k within clusters
Description
For each cluster, extract all sequence of length k
from the ordered observations grouped by individual
IDs. Returns a list of sequences per cluster.
Usage
get_cluster_sequences(
dt,
cl_col = "cl",
id_col = "link_id",
event_col = "reg",
aos_col = "aos",
cens = "cens",
k = 2
)
Arguments
dt |
A |
cl_col |
Name of the column containing cluster labels. |
id_col |
Name of the column identifying individual trajectories (e.g. patient ID). |
event_col |
Name of the column containing ordered events (e.g. diagnoses, prescriptions). |
aos_col |
Name of the column containing age at onset. |
cens |
Code indicating censoring. |
k |
Integer specifying the sequence length (recomended 2). |
Value
A named list of data frames, each containing sequences of length k
observed in a given cluster.
Author(s)
Marc Delord
References
Delord M, Douiri A (2025) doi:10.1186/s12874-025-02476-7
See Also
cspade
in the arulesSequences package for sequential pattern
mining using the SPADE algorithm.