in my studies I am analyzing historical wind speeds of meteorological stations (if the trend is increasing or decreasing etc.). Now i have one value for each day. I want to count the days, which are related to each other (for example 1958-03-18, 19, 20...). for every year i want to have a value how many (storm)days occured with more than 3 days in a row.
example:
1982-01-30 41.04
1982-02-02 45.72
1982-02-03 46.8
1982-02-04 41.04
1982-02-12 39.24
1982-02-17 53.28
1982-02-18 49.68
1982-02-19 40.32
1982-03-01 46.08
In February 1982 2 times is the situation (2,3,4) and (17,18,19).
Does anyone know how to count this and put it in a new table for further analyzing / plotting?
1982 23
1983 7
1984 11
.
.
.
At least just counting all days per year would help me,too.
Kind Regards Sascha
Below is a simple way to identify storm days (wind > 39 according to your comment) and dates with three successive storm days.
Your output would look something like this:
You can summarise by year and do whatever other analyses you require, either with all storm days (dfs) or with three-day storm days only (dfs3).
When you are more famiiar with R, you could tackle the task in various other ways e.g. with package dplyr