heat_map | R Documentation |
Makes a heatmap with optional row/column ordering and aligned dendrograms.
heat_map(
mat,
ord = NULL,
ord_x = NULL,
ord_y = NULL,
draw_dendro = FALSE,
return_data = FALSE,
show_legend = TRUE,
plot_title = NULL,
axis_text_x = colnames(mat),
axis_text_y = rownames(mat),
axis_title_x = waiver(),
axis_title_y = waiver(),
colours = c("red", "yellow"),
limits = NULL,
oob = scales::squish,
legend_breaks = waiver(),
legend_labels = waiver(),
legend_title = waiver(),
axis_ticks = element_blank(),
axis_ticks_length = 0,
axis_text_size = 7,
plot_margin = c(5.5, 5.5, 5.5, 5.5),
rel_widths = c(heatmap = 1, dend = 0.2, legend = 0.2),
rel_heights = c(heatmap = 1, dend = 0.2),
...
)
mat |
A numeric matrix. |
ord |
An optional ordering object with which to reorder both the rows and the columns of |
ord_x |
An optional ordering object with which to reorder the columns of |
ord_y |
An optional ordering object with which to reorder the rows of |
draw_dendro |
Logical or character indicating whether to draw dendrograms or which dendrograms to draw. Possible values are |
return_data |
Logical indicating whether to return a data frame (in long format) containing the data used to construct the heatmap. |
show_legend |
Logical indicating whether to show the heatmap legend. |
plot_title |
The title of the plot. Set to |
axis_text_x |
Character vector of x axis labels. These will be re-ordered if |
axis_text_y |
Character vector of y axis labels. These will be re-ordered if |
axis_title_x |
The x axis title. Set to |
axis_title_y |
The y axis title. Set to |
colours |
The colours to be used in the heatmap. These will be converted to a colour scale by ggplot2's |
limits |
Two-element numeric vector specifying the limits to use for the colour scale. |
oob |
A function to handle values lying outside the range specified by |
legend_breaks |
A numeric vector of legend breaks. |
legend_labels |
A vector of legend labels. |
legend_title |
The legend title. Set to |
axis_ticks |
As |
axis_ticks_length |
As |
axis_text_size |
The size of the axis text. Default: 7. |
plot_margin |
Numeric vector of plot margins in pts, in the order top, right, bottom, left. Default: c(5.5, 5.5, 5.5, 5.5). |
rel_widths |
Named vector of relative widths to be passed to cowplot's |
rel_heights |
Named vector of relative heights to be passed to cowplot's |
... |
Additional arguments to be passed to ggplot2's |
If return_data
is FALSE
, a ggplot
object. If return_data
is TRUE
, a list with two elements: plot
, a ggplot
object; and data
, a data frame.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.