heat_matrix | R Documentation |
Plot heatmap from a matrix
heat_matrix(mat, base_size = 12, digits = 2, show_value = FALSE)
mat |
A matrix to show, column by x-axis and row by y-axis |
base_size |
Numeric value for the base size in theme_bw |
digits |
Integer value for the number of digits to show |
show_value |
Logical value for showing the value for each element or not |
A ggplot heatmap visualization of the passed matrix.
mat <- matrix(rnorm(9), ncol = 3, nrow = 3) + diag(rnorm(3, 2, 0.1)) rownames(mat) <- paste0("sample_", letters[1:3]) colnames(mat) <- paste0("var_", 1:3) heat_matrix(mat) # Additional arguments. heat_matrix(mat, base_size = 6) heat_matrix(mat, show_value = TRUE) heat_matrix(mat, show_value = TRUE, digits = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.