title: Binning data, finding results by group, and plotting using R
body: <p>The pre-installed quakes dataset has 5 variables and 1000 observations. </p>
  
  <p>The simple graph I'm trying to create should show the average earthquake magnitude by earthquake depth category (i.e. Y-axis = Magnitude , X-axis = Depth Categories). </p>
  
  <p>In this dataset, the earthquake depth variables range from 40 to 680. I would like to turn the 1000 observations of earthquake depth into 8 categories, e.g. 40 - 120, 121 - 200, ... 600 - 680. Then, I'd like to take the average earthquake magnitude by depth category and plot it on a line chart.</p>
  
  <p>I appreciate any help with this. 
  Thanks! </p>