Creating a sliding window with the slider R package to quantify the level of drought (CC239)

Creating a sliding window with the slider R package to quantify the level of drought (CC239)

9.274 Lượt nghe
Creating a sliding window with the slider R package to quantify the level of drought (CC239)
Creating a sliding window with the slider R package to quantify the level of drought (CC239) The slider R package has a great set of slide functions to bulid sliding windows across a tidy dataframe. The syntax is very similar to the map functions from purrr. Watch as Pat shows how to quantify the amount of drought using the slide and slide_dbl functions from slider. He'll also compare those functions to the lag and lead fuctions from dplyr. Finally, he makes a plot showing when droughts have occurred over the past 130 years in Southeastern Michigan. He does all this using local weather data downloaded from NOAA in RStudio with a lot of help from the tidyverse You can find my blog post for this episode at https://www.riffomonas.org/code_club/2022-08-15-drought. #slider #ggplot2 #dplyr #R #Rstudio #Rstats 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 3:50 Using lag and lead to create a sliding window the painful way 6:12 Introduction to using slider package 12:02 Applying slider::slide to precipitation data 15:26 Identifying cases of meteorological drought 21:43 Visualizing amount of precipitation within windows over the year 24:12 Adding line to indicate drought threshold 27:16 Highlighting precipitation data from 2012 29:44 Improving appearance of figure