heat_map {biometryassist} | R Documentation |
Produce a heatmap of variables in a grid layout.
Description
This function plots a heatmap of variables in a grid layout, optionally grouping them.
Usage
heat_map(
data,
value,
x_axis,
y_axis,
grouping = NULL,
raster = TRUE,
smooth = FALSE,
palette = "default",
...
)
Arguments
data |
A data frame containing the data to be plotted. |
value |
A column of |
x_axis |
The column of |
y_axis |
The column of |
grouping |
An optional grouping variable to facet the plot by. |
raster |
Logical (default: |
smooth |
Logical (default: |
palette |
Colour palette to use. By default it will use the |
... |
Other arguments passed to |
Value
A ggplot2
object.
Examples
set.seed(42)
dat <- expand.grid(x = 1:5, y = 1:6)
dat$value <- rnorm(30)
dat$groups <- sample(rep(LETTERS[1:6], times = 5))
heat_map(dat, value, x, y)
# Column names can be quoted, but don't need to be.
heat_map(dat, "value", "x", "y", "groups")
# Different palettes are available
heat_map(dat, value, x, y, palette = "Spectral")
# Arguments in ... are passed through to facet_wrap
heat_map(dat, value, x, y, groups, labeller = ggplot2:::label_both)
heat_map(dat, value, x, y, groups, scales = "free_y")
heat_map(dat, value, x, y, groups, nrow = 1)