The pre-installed quakes dataset has 5 variables and 1000 observations.
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).
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.
I appreciate any help with this. Thanks!