Relative Content

Tag Archive for dplyrrstudiogroupingrle

How can I count the number of consecutive days grouping by year and climate division in Rstudio?

I want to count the number of heatwaves, or consecutive days, for each climate division (CLIMDIV) and year from my dataframe. This dataset is filtered from a complete list of climate divisions and years with temperatures, so that I only have dates that are above 32C. Basically, I’m trying to see how many times in each year in each climate division that there were 2 consecutive days, 3 consecutive days, and 4 consecutive days over 32C, or heatwaves of various lengths.