title: Finding the sum in R using conditions
body: <p>I would like to know how to do a conditional sum in R. Let's say I want only the sum of Store ID = 111111 in the year 2012. How would I do this? </p>
  
  <pre><code>YEAR       STORE ID       AMOUNT
  2011       111111         11
  2011       222222         12
  2012       111111         4 
  2012       222222         4 
  2012       111111         45
  2012       333333         7
  </code></pre>