title: R: Sum values in a Data Frame based on values in other columns
body: <p>I'm working with a data frame and it is formatted as follows:</p>
  
  <pre><code>Instrument |    Date    |    Time    | MilliSecond |  Volume
  --------------------------------------------------------------
  ABC        | 5/20/2012  |  10:30:20  |    205      |   123
  --------------------------------------------------------------
  ABC        | 5/20/2012  |  10:30:20  |    205      |   456
  --------------------------------------------------------------
  ABC        | 5/20/2012  |  10:30:20  |    205      |   789
  --------------------------------------------------------------
  ABC        | 5/20/2012  |  10:31:12  |    329      |   150
  --------------------------------------------------------------
  ABC        | 5/20/2012  |  10:31:12  |    329      |   430
  --------------------------------------------------------------
  DEF        | 5/20/2012  |  10:32:40  |    430      |   58
  --------------------------------------------------------------
  DEF        | 5/20/2012  |  10:32:40  |    430      |   164
  --------------------------------------------------------------
  GHI        | 5/20/2012  |  10:33:27  |    531      |   762
  --------------------------------------------------------------
  </code></pre>
  
  <p>What I'd like to do is sum the values in the Volume column based on the Instrument, the Date, the Time, and the Millisecond columns so that I am able to get a data frame that looks like this:</p>
  
  <pre><code>Instrument |    Date    |    Time    | MilliSecond |  Volume
  --------------------------------------------------------------
  ABC        | 5/20/2012  |  10:30:20  |    205      |   1368
  --------------------------------------------------------------
  ABC        | 5/20/2012  |  10:31:12  |    329      |   580
  --------------------------------------------------------------
  DEF        | 5/20/2012  |  10:32:40  |    430      |   222
  --------------------------------------------------------------
  GHI        | 5/20/2012  |  10:33:27  |    531      |   762
  --------------------------------------------------------------
  </code></pre>
  
  <p>(To put it simply, if the Instrument, Date, Time, and MilliSecond column are the same for several rows, I would like to sum the Volume and then put it all into one row)</p>
  
  <p>Does anyone know a good way I can go about doing this? There was a similar question here before but it was a bit different and I can't really apply it to my data frame (especially since I have to sum the Volume based on several columns). Thanks in advance.</p>