Usage
createHeatmap(data, x, y, fill, facet = NULL, ncol = 1, baseSize = 12, baseFamily = "sans", thresholdValue = NULL, thresholdName = fill, text = FALSE, textFill = fill, percent = FALSE, digits = ifelse(percent, 2, 4), divergingColourGradient = FALSE, lowGradient = ifelse(divergingColourGradient, muted("red"), "#56B1F7"), midGradient = "white", highGradient = ifelse(divergingColourGradient, muted("blue"), "#132B43"), title = paste("Heatmap by", fill), subtitle = NULL, xlab = x, ylab = y, legendPosition = "right", fillGuide = "colorbar", defaultTheme = theme_tufte(base_size = baseSize, base_family = baseFamily), themeExtra = NULL)
Arguments
data
data frame contains data computed for heatmap
x
name of a column containing x variable values (1st or horizontal dimenstion) in 2D matrix
y
name of a column containing y variable values (2d or vertical dimension) in 2D matrix
fill
name of a column with values to map to heatmap gradient colors (lowGradient
,
highGradient
, and optionally midGradient
).
facet
vector of 1 or 2 column names to split up data to plot the
subsets as facets. If single name then subset plots are placed next to
each other, wrapping with ncol
number of columns (uses facet_wrap
).
When two names then subset plots vary on both horizontal and vertical
directions (grid) based on the column values (uses facet_grid
). ncol
number of facet columns (applies when single facet column supplied only
- see parameter facet
).
thresholdValue
threshold to use to display data in heatmap (if NULL then do not use threshold)
thresholdName
name of data attribute from data
to use (by defult use fill
)
text
if TRUE then display values in heatmap table (default: FALSE)
textFill
text to display (applies only when text
is TRUE), by defaul use fill
values
percent
format text as percent
digits
number of digits to use in text
divergingColourGradient
logical diverging colour gradient places emphasize on both low and high leaving
middle neutral. Use when both end grandient colours represent critical values such as negative and positive
extremes (e.g. temprature, outliers, etc.).
lowGradient
colour for low end of gradient.
midGradient
colour for mid point.
highGradient
colour for high end of gradient.
xlab
a label for the x axis, defaults to a description of x.
ylab
a label for the y axis, defaults to a description of y.
legendPosition
the position of legends. ("left", "right", "bottom", "top", or two-element numeric
vector). "none" is no legend.
fillGuide
Name of guide object, or object itself for the fill
. Typically "colorbar"
name
or object guide_colourbar
. themeExtra
any additional theme
settings that override default theme.