Learn R Programming

LPS (version 1.0.4)

heat: Heatmap palette generation

Description

This function generates a ramp of colors for heat.map derivated functions.

Usage

heat(colors = c("#8888FF", "#000000", "#FF4444"), n = 256, shapeFun = heat.exp, ...)
  heat.exp(n, part, base = 1.015)
  heat.lin(n, part)

Arguments

colors
Character vector of length 3, determining starting, middle and final colors.
n
Single integer value, amount of colors / values to generate.
shapeFun
Function taking at least 2 arguments : n and part. heat.exp and heat.lin are provided as examples.
...
Further arguments to heat will be passed to shapeFun.
part
Single integer, defined as 1 while generating colors between the first two boundaries, and 2 otherwise.
base
Single numeric value, base for exponential slope.

Value

  • heat returns a character vector of colors in hexadecimal representation. heat.lin and heat.expr return n numeric values, defining a curve whose slope will be mimiced during color interpolation.

See Also

colorRampPalette heat.map, clusterize, predict.LPS

Examples

Run this code
# Classical heatmap colors
  palette <- heat(c("green", "black", "red"))
  heat.scale(zlim=c(-2,2), col.heatmap=palette)
  
  # Two distinct shapes provided
  heat.scale(zlim=c(-2,2), col.heatmap=heat(shapeFun=heat.lin))
  heat.scale(zlim=c(-2,2), col.heatmap=heat(shapeFun=heat.exp))

Run the code above in your browser using DataLab