---
layout: post
title: "Incorporating logic into a visual made with R using a case_when statement (CC263)"
blurb: "Adding some polish with case_when"
author: "PD Schloss"
date: 2022-11-07 11:00
comments: false
youtube: ddJtPQ9FECQ
start_hash: 27aabc4cd5535350794278203018b681e88456b4
end_hash: c2295b25ca51cfea5f0902688e48de2cd708fc8f
---

Pat uses a case_when logic statement to construct the title of a visual he's made in R to change with the date. Because the visual gets recreated every day, it is important for the format of the date in the title to change with the day. The overall goal of this project is to highlight reproducible research practices using a number of tools. The specific output from this project will be a map-based visual that shows the level of drought across the globe. The website we generate in this episode can be found at https://www.riffomonas.org/drought_index.

<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}})
