I have a table with temperatures multiple values every month for 21 years.
df <- data.frame(month=rep(c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"), times = 20, each = 3),
year=rep(c("2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2020"), times = 1, each = 3),
Temperature=rep(c("4", "5", "6", "9", "10", "12","15", "16", "15", "14", "11", "8"), times = 20, each = 3))
The frame looks like that
df
I have done some analyses. I want to count for how many times the mean temperatures(>8) of each month has been over a threshold on this timespan.
This is what I am trying but I have hit a wall.
countdf <- df |>
group_by(month) |>
summarise(Temperature = mean(Temperature))