Amazing technological breakthrough possible @S-Logix

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • +91- 81240 01111

Social List

How to create heatmap plot in R?


To create heatmap plot using R programming.


   Mainly used for Cluster analysis.

   It substitutes numbers with coloured cells

   R Package :gplots

   R Function : heatmap(x, scale=, xlab= ,ylab= , main= ,col= )

x: Data set(mtcars)

Scale: character indicating if the valuesshould be centered and scaled ineither the row direction or the column direction, or none.

xlab: Label for x

ylab: Label for y

main: title of the graph

Sapmle Code

#Heat Map


#Adding Scale and Labels
heatmap(input,scale=”column”,xlab = “Variable”,ylab = “Car Model”,main=”Heatmap Plot”)

#Changing color
heatmap(input,scale=”column”,xlab = “Variable”,ylab = “Car Model”,main=”Heatmap Plot”,col=terrain.colors(256))

create heatmap plot in R
Heat Map
Changing color