title: R- Collapse rows and sum the values in the column
body: <p>I have the following dataframe (df1):</p>
  
  <blockquote>
  <pre><code>ID    someText    PSM OtherValues
  ABC   c   2   qwe
  CCC   v   3   wer
  DDD   b   56  ert
  EEE   m   78  yu
  FFF   sw  1   io
  GGG   e   90  gv
  CCC   r   34  scf
  CCC   t   21  fvb
  KOO   y   45  hffd
  EEE   u   2   asd
  LLL   i   4   dlm
  ZZZ   i   8   zzas
  </code></pre>
  </blockquote>
  
  <p>I would like to collapse the first column and add the corresponding PSM values
  and I would like to get the following output:</p>
  
  <pre><code>ID  Sum PSM
  ABC 2
  CCC 58
  DDD 56
  EEE 80
  FFF 1
  GGG 90
  KOO 45
  LLL 4
  ZZZ 8
  </code></pre>
  
  <p>It seems doable with aggregate function but don't know the syntax.
  Any help is really appreciated! Thanks.</p>