---
layout: post
title: "Creating a heatmap map with geom_tile from ggplot2 in R (CC258)"
blurb: "How to make a heat map in R"
author: "PD Schloss"
date: 2022-10-20 11:00
comments: false
youtube: FnJKF3QfqwY
start_hash: ed85dbc798f62a4ccdcc7579da3047ae787202d7
end_hash: db86885cf9aac7a409cfa2b502bf2dd030c36054
---

Pat shares how to create a world-wide map of precipitation data as a heatmap using ggplot2's geom_tile function in R. 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.

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Code

You can browse the state of the repository at the

* [beginning of the episode](https://github.com/riffomonas/drought_index/tree/{{page.start_hash}})
* [end of the episode](https://github.com/riffomonas/drought_index/tree/{{page.end_hash}})
