Creates heatmaps, such as correlation matrices, with Insper's visual identity. Accepts either a matrix or a data frame in long format.
Usage
insper_heatmap(
data,
show_values = FALSE,
value_color = "white",
value_size = 3,
palette = "vermelho_turquesa",
...
)Arguments
- data
A matrix (for example, from
cor()) or a long data frame with columnsVar1,Var2, andvalue.- show_values
Logical. If
TRUE, prints values on the tiles. Default isFALSE.- value_color
Character. Color of the printed values. Default is
"white".- value_size
Numeric. Size of the printed values. Default is 3.
- palette
Character. Palette for the continuous fill scale. Default is
"vermelho_turquesa".- ...
Additional arguments passed to
ggplot2::geom_tile().
Examples
if (FALSE) { # has_insper_fonts()
# From a correlation matrix
cor_mat <- cor(mtcars[, 1:4])
insper_heatmap(cor_mat)
# Print values on the tiles
insper_heatmap(cor_mat, show_values = TRUE)
# Another diverging palette
insper_heatmap(cor_mat, palette = "roxo_verde")
}
