convert_to_events | R Documentation |
A function that converts the id and sequence into a dataframe which contains the id, period, and event.
convert_to_events(data, id_column, sequence_column)
data |
A data frame that has a column which is an identifier variable (ex. id), and another that represents a sequence with as a character class. |
id_column |
The column which is the identifier variable. |
sequence_column |
The column which contains the sequences as a character class. |
Returns a dataframe with 3 columns:
* id * period * event
data("mvad") clustered_kmed <- mvad %>% aggregate_sequences(format = "%Y-%m-%d", unit = "month", n_units = 1, summary_stats=FALSE) %>% cluster_kmedoids(k = 5) patterns_kmed <- clustered_kmed %>% filter_pattern(threshold = 0.5, pattern_name = 'consensus') formatted_kmed <- patterns_kmed %>% format_sequence() formatted_kmed %>% convert_to_events("cluster", "consensus_pattern")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.