Date_Time wind_cardinal_direction_set_1d weather_condition_set_1d n
<dttm> <chr> <chr> <int>
1 2015-01-01 01:00:00 N Fog 1
2 2015-01-01 01:00:00 N Mist 2
3 2015-01-01 02:00:00 N Fog 2
4 2015-01-01 02:00:00 N Mist 1
5 2015-01-01 03:00:00 N Fog 3
6 2015-01-01 04:00:00 N Mist 3
7 2015-01-01 05:00:00 N Mist 3
8 2015-01-01 06:00:00 N Mist 3
9 2015-01-01 07:00:00 N Fog 2
10 2015-01-01 07:00:00 N Mist 1
# ... with 6,798 more rows
>
For each date-time combination, I want to keep the one with the max value of n
df_cat %>% filter(df_cat$n>df_cat$n,)