title: How to sum one column based on another column
body: <p>this is my first post so please excuse any irregularities. I am working on textual analysis with R and am currently trying to sum up the columns of my data frame conditioned on another column. Specifically, my results 'dfResults' looks as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/fNj0l.png" rel="nofollow noreferrer">dfResults</a></p>
  
  <p>I want to count the word frequencies for all positive words (1) and separately the frequencies of all negative words (-1) so that I can easily calculate the sentiment score. This is probably very easy, but I tried the aggregate and sum functions and it did not work. Would appreciate the help!</p>