Plot Gazepoint AOI transition matrix
Source:R/plot_gazepoint_aoi_transition_matrix.R
plot_gazepoint_aoi_transition_matrix.RdPlot a heatmap of AOI transition counts or probabilities from the output of
compute_gazepoint_aoi_transition_matrix() or from a compatible long-form
transition table.
Usage
plot_gazepoint_aoi_transition_matrix(
transitions,
value = c("prob", "n"),
state_order = NULL,
by_cols = NULL,
include_zero = TRUE,
show_labels = TRUE,
label_digits = 2,
label_size = 3,
facet = TRUE,
title = NULL
)Arguments
- transitions
A
gp3_aoi_transition_matrixobject, a long-form transition table withfrom,to,n, and/orprobcolumns, or a numeric matrix with AOI states as row and column names.- value
Which value to plot:
"prob"for transition probabilities or"n"for transition counts.- state_order
Optional character vector defining the AOI order on the heatmap axes.
- by_cols
Optional character vector of grouping columns to facet by. If
NULL, the function uses grouping columns stored in agp3_aoi_transition_matrixobject, when available.- include_zero
Logical. If
TRUE, all possible state-to-state cells are shown, with missing transitions displayed as zero.- show_labels
Logical. If
TRUE, cell values are printed inside tiles.- label_digits
Number of digits used when labelling probabilities.
- label_size
Text size for cell labels.
- facet
Logical. If
TRUE, grouped transition tables are faceted.- title
Optional plot title.