
Plot each unit's sequence of assigned profiles across the occasions as a row of coloured cells
Source:R/plot-named.R
plot_sequences.Rdplot_sequences() plots each group's (person's) sequence of profiles as a
row of coloured cells: one row per group, one cell per occasion, coloured by
the profile the observation at that occasion is assigned to (its most likely
one). Within a block the rows are sorted by each group's most frequent
profile, so groups with similar sequences sit together. An occasion at which
nothing was observed is shown grey, and one absent from the data is left
blank.
Arguments
- x
A fit with ordered occasions:
a transition fit from
lta(), of either class (multilpa_transitionsormultilpa_lta), except one withmeasurement = "occasion", whose profiles differ by occasion;a profile or class fit from
lpa(),lca(),multilpa()ormultilca()(with or without membership covariates) made withtime.
- labels
TRUE(default) puts the rows in blocks under labelled strips: one block per group class when the fit has two or more group classes, otherwise one per most frequent profile.FALSEdraws the rows in the same order as one block without strips.- cell_labels
TRUE(default) prints the profile number in each cell when the grid has at most 60 rows and 40 occasions; a larger grid shows the profiles by colour, with a dash still marking an occasion that observed nothing when the grid also has noise or absent occasions.FALSEnever prints the numbers.- main, subtitle
Title and subtitle of the plot, each one string;
NULL(default) keeps the view's own.
Value
A ggplot object, which draws the plot when printed. Conditions raised:
latents_no_time: a profile or class fit made withouttime;latents_nothing_to_plot: a model with no sequence view (anlta()fit withmeasurement = "occasion", a growth mixture, a mixture regression, an additive or cross-level fit, pooled imputations);latents_not_a_fit:xis not a fitted model.
See also
plot_transitions() for the transition matrix. The sequences as
a table: get_results(x, "sequences") for a profile or class model and
a transition fit of class multilpa_transitions;
get_results(x, "assignments") (one row per observation, with its
profile) for a general transition fit of class multilpa_lta.
