This function creates a heatmap using the numeric columns from the
provided data frame. It provides the ability to hide row and
column names, adjust font sizes and clustering, and apply
additional transformations such as log10 or combined z‑scoring. A
file name with extension may be provided via title to save the
heat map to disk; otherwise the plot is drawn on the active
graphics device.
Arguments
- data
A data frame. Only numeric columns are used to construct the heat map.
- scale
Character specifying an optional scaling. Accepts
NULL(no scaling), "log2", "log10", "row_zscore", "col_zscore" or "zscore" (apply both row and column z‑scoring). Default isNULL.- annotation_col
Optional. Either the name of a column in
dataor a vector of length equal to the number of rows or columns of the numeric matrix. If a column name is supplied the function determines whether it annotates rows or columns based on its length or the value ofannotation_side.- annotation_side
Character. One of "auto", "row" or "col". When "auto" (default) the side is determined by matching the length of
annotation_colto rows or columns.- show_row_names
Logical. If
TRUErow names are shown Default isFALSE.- show_col_names
Logical. If
FALSEcolumn names are hidden. Default isTRUE.- fontsize_row
Numeric. Font size for row names. Default is 10.
- fontsize_col
Numeric. Font size for column names. Default is 10.
- cluster_rows
Logical. If
TRUE(default), rows are clustered.- cluster_cols
Logical. If
TRUE(default), columns are clustered.- title
Character. The heat map title or file name. If
titleends with ".pdf" or ".png" (case insensitive), the heat map is saved to that file and no title is printed on screen. IfNULL(default), the heat map is drawn on the active device without saving and without a main title.
Value
Invisibly returns the pheatmap object created by
pheatmap::pheatmap().

