title: rowSum problems in dplyr - 'x' must be numeric
body: <p>I come across problems when trying to make rowSums in dplyr.</p>
  
  <p>After grouping the data via</p>
  
  <pre><code>data &lt;- data %&gt;%
    group_by(location, category) %&gt;% 
    summarise(amount = sum(amount)) %&gt;%
    spread(key = "category", value = "amount", fill = 0)
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code># A tibble: 4,211 x 140
  # Groups:   location [4,211]
                         location    art      books     cars 
   *                        &lt;chr&gt;    &lt;dbl&gt;    &lt;dbl&gt;     &lt;dbl&gt;                         
   1                 New York, NY    0         10       0                    
   2              Los Angeles, CA    12        0        2           
   ...
  </code></pre>
  
  <p>Then trying to make the rowSum didn't work:</p>
  
  <pre><code>data %&gt;% mutate(sum=rowSums(.))
  
  Error in mutate_impl(.data, dots) : 
    Evaluation error: 'x' must be numeric.
  
  &gt; class(ks)
  [1] "grouped_df" "tbl_df"     "tbl"        "data.frame"
  </code></pre>
  
  <p>I tried to change the pivot like below, but it didn't help either:</p>
  
  <pre><code>data &lt;- data %&gt;%
    group_by(location, category) %&gt;% 
    summarise(amount = as.numeric(sum(amount))) %&gt;%        # Changed
    spread(key = "category", value = "amount", fill = 0)
  
  str(data.frame(data))
  
  'data.frame':   4211 obs. of  140 variables:
   $ location                    : chr  "New York, NY" "Los Angeles, CA" ... ...
   $ art                         : num  0 0 0 0 0 0 0 0 0 0 ...
   $ books                       : num  0 0 0 0 0 0 0 0 0 0 ...
   $ cars                        : num  0 0 0 0 0 0 0 0 0 0 ...
   ...     
  </code></pre>
  
  <p>It would be great to have some help here.</p>
  
  <p><em>After</em> calculating the sum of each row, I need to filter locations that have a rowsum &lt; 1000. It would also be great to know how to do this and if <code>dplyr</code> is the right approach in general.</p>