- df
A data.frame with containing values with which to populate the heatmap.
The data.frame must include columns specifying the lower categories (`ylower`,
`xlower`) and upper groups (`yupper`, `xupper`) that each value corresponds to.
These categories and groups will be used to arrange and label the rows and
columns of the heatmap. It must also contain a `values` variable containing the
values used to populate the heatmap. Note that the groups will by default be
arranged alphabetically (top to bottom / left to right). The ordering of the
groups can be manually specified by converting yupper and/or xupper to factors.
In this case, the groups will be ordered based on the ordering of the factor
levels.
- ylower
A column in `df` containing the categories that will be presented
as rows along the y-axis of the heatmap.
- yupper
A column in `df` containing the groupings that will be used to
arrange the heatmap rows.
- xlower
A column in `df` containing the categories that will be presented
as columns along the x-axis of the heatmap.
- xupper
A column in `df` containing the groupings that will be used to
arrange the heatmap columns.
- values
A column in `df` containing the values used to populate the
heatmap.
- rm_diag
Do not show values for categories along the x and y axes that
are identical (defaults to `FALSE`). This is particularly useful for
origin-destination heatmaps, where the user may want to hide the diagonal
values.
- lgttl
Option to manually define legend title.
- bins
Option to break the data into a specified number of groups
(defaults to `NULL`). The thresholds between these groups will be equally
spaced between zero and the maximum value observed in `values`.
- cbrks
Vector of custom breaks, if users wish to use a discrete legend
colour scheme (defaults to `NULL`). For example, a supplied vector of `c(5,10,
20)` would break he values up into 5 ordered groups of ranges 0, 0-5, 5-10,
10-20 and 20+.
- cclrs
Vector of hexcodes, which to create a custom legend colour scheme
(defaults to `NULL`). If `cbrks` is supplied, `cclrs` must have a length
two longer than `cbrks`. If `bins` is supplied, `cclrs` must have a length
equal to the values provided to `bins`.
- norm_lgd
Normalised to between 0 and 1 in legend (defaults to `FALSE`).
Allows for consistency when comparing heatmaps across different datasets. At
present, this only works if all heatmap values are positive.
- lgdps
If using custom breaks, define the number of decimal points to
round the legend scale to (defaults to 0). If `norm_lgd` is `TRUE`, it will
default to 3.
- xttl_height
The space allocated to the group titles on the x-axis as a
proportion of the heatmap's height (defaults to 0.15).
- yttl_width
The space allocated to the group titles on the y-axis as a
proportion of the heatmap's width (defaults to 0.15).