0

I have a large dataset (n>11,000) with two columns

witches$decade and witches$tried

I am trying to make a histogram of the sum of all tried by decade (witches$tried has different values for every entry).

I thought of subsetting by decade and assigning the sum of the subsets to a vector, but as the decades go from 1300-1850 doing it by hand is not really an option.

Does anyone have any ideas? Thanks:)

berrs2002
  • 1
  • 1
  • Pick your favorite method from the FAQ [How to sum by group?](https://stackoverflow.com/q/1660124/903061). I'd recommend the `dplyr` method: `library(dplyr)` then `witches %>% group_by(decade) %>% summarize(n_tried = sum(tried))`. – Gregor Thomas Dec 01 '22 at 04:21

0 Answers0