Renders the transition probability (or count) matrix returned by
compute_transitions() as a heatmap using ggplot2.
Arguments
- transitions
The
matrixelement of the list returned bycompute_transitions(): a tibble with afromcolumn plus one numeric column per to stage.- label_values
If
TRUE(default), cell values are printed inside each tile.NAcells (unvisited from-stages) are left blank.- digits
Number of decimal places for cell labels. Default
2.- title
Optional plot title.
Examples
if (FALSE) { # \dontrun{
hyp <- read_hypnogram("night_001.csv")
trans <- compute_transitions(hyp)
plot_transition_matrix(trans$matrix)
} # }