title: Is there an R function to subtotals certain rows/columns to easily plot by line or bar chart?
body: <p>I'm trying to sum the totals of each course status by School letter. Is there a function that I can write to group by School and sum totals for each column? </p>
  
  <p>I wrote the function Group by School to get totals for every school but am having a hard time putting it into a visual using ggplot etc. </p>
  
  <p>Dataframe is MathClass with School as a factor and courses as numerics. </p>
  
  <pre><code>#Group by School
  GroupbySchool &lt;- MathClass %&gt;%
  group_by(School) %&gt;%
  summarise_all(funs(sum)) 
  
    School Middling Behind `More Behind` `Very Behind` Completed
    &lt;fct&gt;     &lt;dbl&gt;  &lt;dbl&gt;         &lt;dbl&gt;         &lt;dbl&gt;     &lt;dbl&gt;
  1 A           113    450            73           154       142
  2 B            84    201            14            22       125
  3 C            11     39             4            12        19
  4 D             3      8             2             6         3
  5 E            11     56             7            15        27
  </code></pre>