Pat shares how to create a world-wide map of precipitation data as a heatmap using the geom_tile function from ggplot2. To generate the final figure he is plotting the z-score of monthly precipitation for each longitude and latitude relative to the precipitation over the past 30 days for each long and lat combination. The overall goal of this project is to highlight reproducible research practices using a number of tools including ggplot, geom_raster, geom_tile, scale_fill_gradient2, labs, theme, and more. The specific output from this project will be a map-based visual that shows the level of drought across the globe.
You can find my blog post for this episode at https://www.riffomonas.org/code_club/....
#geom_tile #Rstats #R
Support Riffomonas by becoming a Patreon member!
/ riffomonas
Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at https://shop.riffomonas.org/youtube to get practice problems, tips, and insights.
If you're interested in taking an upcoming 3 day R workshop be sure to check out our schedule at https://riffomonas.org/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
2:44 Creating a heatmap with geom_tile
6:30 Modifying fill color gradient
10:16 Rescaling color gradient to increase contrast
13:51 Formatting and placing the legend
17:58 Saving and modifying appearance of visual
19:37 Adding dynamic titles
23:17 Updating snakefile and committing changes