make_heatmap: Make a Heatmap for a Grid

View source: R/GraphingFunctions.R

make_heatmapR Documentation

Make a Heatmap for a Grid

Description

The function makes a heatmap showing cell counts for a grid. By default, darker colours indicate larger counts, while lighter colours indicate smaller counts.

Usage

make_heatmap(
  grid,
  labels = c("agree_disagree", "satisfied_dissatisfied", "positive_negative",
    "accurate_inaccurate", "other"),
  title = "Heatmap for Grid Item",
  pos_labels = NULL,
  neg_labels = NULL,
  colours = c("purple", "green", "red", "custom"),
  custom_palette,
  show_counts = TRUE,
  breaks = NA,
  fontsize = 20,
  fontsize_names = 11
)

Arguments

grid

a matrix.

labels

a character string specifying which set of row names and col names are to be used.

title

the title of the plot.

pos_labels

character. Custom column names.

neg_labels

character. Custom row names.

colours

a character string indicating what colour the heatmap will be. Choosing "custom" allows for setting the custom_palette variable to a palette other than "purple", "green", or "red".

custom_palette

a colour palette, the output of colorRampPalette.

show_counts

logical. If TRUE, counts are shown for each cell.

breaks

A sequence of numbers that covers the range of values in the grid. If the value is NA, the breaks are calculated automatically.

fontsize

base fontsize for the heatmap.

fontsize_names

fontsize for row and column names.

Value

a heatmap showing counts in each grid cell.


douglaswhitaker/GridItemTools documentation built on Aug. 2, 2022, 4:32 a.m.