heat function

Heatmap palette generation

Heatmap palette generation

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

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.

Returns

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.

Author(s)

Sylvain Mareschal

See Also

colorRampPalette

heat.map, clusterize, predict.LPS

Examples

# 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))
  • Maintainer: Sylvain Mareschal
  • License: GPL (>= 3)
  • Last published: 2021-05-29