title: Calculate sum of array cells within a given radius
body: <p>This questions comes after a calculation in GIS (ArcMap 10.1) takes over a month to calculate (and didn't finish yet). Now I am trying to find a faster solution in R.</p>
  
  <p>I have a matrix of ~30,000 x 80,000 cells, where each cell represents a 5x5 meters square. I need to calculate the sum of values in cells that fall within a given radius (3000 meters) from each cell. 
  For the cells on the edge of the matrix I assume a value of 0 outside the matrix.</p>
  
  <p>The question is how to define the cells that fall within the radius.
  There must be a library that has this functionality, but I couldn't find any.</p>
  
  <p>Any suggestions?</p>