MENU

Fun & Interesting

How to create a heatmap in R with geom_tile and geom_text from ggplot2 (CC105)

Riffomonas Project 14,961 4 years ago
Video Not Working? Fix It Now

In this episode of Code Club, Pat will show how to create a heatmap in R using the geom_tile and geom_text functions from ggplot2. A heatmap is a popular chart type for visualizing the relative abundance of microbial ecology data. Pat will describe the strengths of heatmaps over stacked barcharts and piecharts but also the weaknesses of heatmaps. Pat will use RStudio and the #geom_tile and #geom_text functions from the #ggplot2, package. The accompanying blog post can be found at https://www.riffomonas.org/code_club/2021-05-17-heatmap. Do you have a figure that you would like to receive a critique or help improving? Let me know and I'd be happy to arrange a guest appearance! If you're interested in taking an upcoming 3 day R workshop, email me at [email protected]! R: https://r-project.org RStudio: https://rstudio.com Raw data: https://github.com/riffomonas/raw_data/releases/latest Workshops: https://www.mothur.org/wiki/workshops You can also find complete tutorials for learning R with the tidyverse using... Microbial ecology data: https://www.riffomonas.org/minimalR/ General data: https://www.riffomonas.org/generalR/ 0:00 Introduction 3:04 Converting a stacked barchart to a heatmap 8:40 Cutstomizing color gradient 11:04 Stylizing heatmap 14:11 Adding numeric values to tiles 17:17 Creating a genus-level heatmap 19:14 Converting heatmap to colored table 20:24 Critique 24:13 Recap

Comment