I have a dataset like this:
Year Month Day Location Target Perpetrator
1970 5 1 Place1 x A
1970 7 5 Place2 y A
1971 2 3 Place3 x B
1972 10 8 Place4 x C
1972 12 13 Place2 y C
1973 1 3 Place5 z B
I am totally lost on how to do this. I have tried
data <- data %>%
distinct() %>%
count(Perpetrator)
but that only gives me the count of each unique value in "Perpetrator" of course.
The output I was is the count of each unique value in "Perpetrator" by YEAR. How can I do this?