Heatmaps

Heatmaps are a simple but effective way to interpret numeric datasets. They work best when the data to be charted (in a heatmap) has been either aggregated or is of a limited size (rows and columns) so that they can be viewed effectively.

R has a native inbuilt heatmap charting feature. It can be invoked using the R function, heatmap.

Alternatively, there are other R packages for creating impressive heatmaps. One such example is shown as follows. The parameters have been referenced from the site package at https://rlbarter.github.io/superheat/:

devtools::install_github("rlbarter/superheat") 
 
row.names(Hartnagel) <- Hartnagel$year 
 
superheat(Hartnagel[,-1],heat.pal = c("#b35806", "white",
"#542788"),heat.na.col = "white", yr = Hartnagel$mconvict,
yr.axis.name = "Male Conviction Rate",
bottom.label.text.angle = 90,scale=T,
left.label.text.size = 3.5,bottom.label.text.size = 4)

The output is as follows:

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.43.126