View source: R/stacked_sequence_plot.R
stacked_sequence_plot | R Documentation |
Function stacked_sequence_plot
draws stacked sequence plots of sequence
object created with the TraMineR::seqdef function or observations and/or most
probable paths of model objects of seqHMM
(e.g., hmm
and mhmm
).
stacked_sequence_plot(
x,
plots = "obs",
type = "distribution",
ids,
sort_by = "none",
sort_channel,
dist_method = "OM",
group = NULL,
legend_position = "right",
...
)
x |
Either a hidden Markov model object of class |
plots |
What to plot. One of |
type |
The type of the plot. Available types are |
ids |
Indexes of the subjects to be plotted (the default is all). For example, 'ids = c(1:10, 15) plots the first ten subjects and subject 15 in the data. |
sort_by |
A sorting variable or a sort method (one of |
sort_channel |
Name of the channel which should be used for the
sorting. Alternatively value |
dist_method |
The metric to be used for computing the distances of the
sequences if multidimensional scaling is used for sorting. One of |
group |
Variable used for grouping the sequences in each channel, which
is passed to |
legend_position |
Position of legend for each channel,
passed to |
... |
Other arguments to |
p <- stacked_sequence_plot(
mhmm_biofam,
plots = "both",
type = "d",
legend_position = c("right", "right", "right", "none")
)
library("ggplot2")
p & theme(plot.margin = unit(c(1, 1, 0, 2), "mm"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.