I have this data frame (please refer the figure below)
| State | County | Homicides
|--------------|---------------|-----------
| Ags | Calvillo | 4
| Mexico City | Alvaro O | 2
| Mexico City | Alvaro O | 3
| Mexico City | Miguel H | 2
| Gto | Leon | 1
| Gto | Leon | 1
What I want to do is group by County and sum the value of homicides. for example
| State | County | Homicides
|--------------|---------------|-----------
| Ags | Calvillo | 4
| Mexico City | Alvaro O | 5
| Mexico City | Miguel H | 2
| Gto | Leon | 2
As you can see I summarize the values of homicides with the same county name
This was my attempt
df1 >> group_by("County") >> summarize(County = X.County)
But is not doing what I Want, can someone guide me with this question, please.
Thanks