View source: R/sequence_plot.R
| sequence_plot | R Documentation |
Single entry point for three categorical-sequence visualisations.
type = "heatmap" (default): dense carpet, rows reordered
by sort / dendrogram (single panel).
type = "index": same data layout, but rows separated by
thin gaps (no dendrogram). Supports grouping via group or a
net_clustering, plus a ncol x nrow facet grid.
type = "distribution": dispatches to
distribution_plot.
sequence_plot(
x,
type = c("heatmap", "index", "distribution"),
sort = c("lcs", "frequency", "start", "end", "hamming", "osa", "lv", "dl", "qgram",
"cosine", "jaccard", "jw"),
tree = NULL,
group = NULL,
scale = c("proportion", "count"),
geom = c("area", "bar"),
na = TRUE,
row_gap = 0,
dendrogram_width = 1.2,
k = NULL,
k_color = "white",
k_line_width = 2.5,
state_colors = NULL,
na_color = "grey90",
cell_border = NA,
frame = FALSE,
width = NULL,
height = NULL,
main = NULL,
show_n = TRUE,
time_label = "Time",
xlab = NULL,
y_label = NULL,
ylab = NULL,
tick = NULL,
ncol = NULL,
nrow = NULL,
legend = NULL,
legend_size = NULL,
legend_title = NULL,
legend_ncol = NULL,
legend_border = NA,
legend_bty = "n"
)
x |
Wide-format sequence data ( |
type |
One of |
sort |
Row-ordering strategy for heatmap / within-panel for index.
One of |
tree |
Optional |
group |
Optional grouping vector (length |
scale, geom, na |
Passed to |
row_gap |
Fraction of row height used as vertical gap between
sequences in index plots. |
dendrogram_width |
Width ratio of the dendrogram panel (heatmap). |
k |
Optional integer. When supplied in |
k_color |
Colour for the cluster separator lines. Default
|
k_line_width |
Line width for the cluster separators. Default
|
state_colors |
Vector of colours, one per state. |
na_color |
Colour for |
cell_border |
Cell border colour. |
frame |
If |
width, height |
Optional device dimensions in inches. When supplied,
opens a new graphics device via |
main |
Plot title. |
show_n |
Append |
time_label, xlab |
X-axis label. |
y_label, ylab |
Y-axis label (distribution only). |
tick |
Show every Nth x-axis label. |
ncol, nrow |
Facet grid dimensions (index + distribution). |
legend |
Legend position: |
legend_size |
Legend text size. |
legend_title |
Optional legend title. |
legend_ncol |
Number of legend columns. |
legend_border |
Swatch border colour. |
legend_bty |
|
Invisibly, a list describing the plot (shape depends on
type).
distribution_plot, build_clusters
sequence_plot(trajectories)
sequence_plot(trajectories, type = "index")
sequence_plot(trajectories, type = "distribution")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.