I have a data frame which looks the following:
  Person  Rain        Route
1 1    no rain      4.6    
2 1    no rain      3
3 1    rain         20
4 2    rain         12
5 2    rain         3
6 2    no rain      5
so basically every Person has 3 rows.
Now, I want to sum the number of routes of every person based on the condition if it rained or not. Then I want to count the number of days it rained, or not. My desired output should look like this:
  Person  Rain        Route   frequencies
1 1       no rain      7.6        2
2 1       rain         20         1
3 2       rain         15         2
4 2       no rain      5          1
I am very grateful for any advice Thank you a lot
 
     
    