title: Is there a way to divide answers of group_by summary statistics in R?
body: <p>I'm trying to subset data from three vectors and then apply arithmetic to the summary statistics but I'm having issues with count(). Below is the summary using (summarise, dplyr), but I want it to return as the percentage of unfiltered (X_age65yr).<br>
  For example, filtered count results for Alabama is 1667, total count is 2411. I'd like Alabama, and all subsequent states, to return the filtered count by total, or 1667/2411 = .6914 or 69.14%</p>
  
  <pre><code>cthigh &lt;- brfss2013 %&gt;% filter(bphigh4 == "Yes", !is.na(X_age65yr),X_age65yr == "Age 65 or older") %&gt;%
     group_by(X_state) %&gt;% summarise(count = n())
  
  cthigh
  # A tibble: 53 x 2
     X_state              count
     &lt;fct&gt;                &lt;int&gt;
   1 Alabama               1667
   2 Alaska                 507
   3 Arizona                930
   4 Arkansas              1352
   5 California            1817
   6 Colorado              2302
   7 Connecticut           1488
   8 Delaware              1123
   9 District of Columbia  1032
  10 Florida               8924
  # ... with 43 more rows
  
  ctall &lt;- brfss2013 %&gt;% filter(!is.na(X_age65yr),X_age65yr == "Age 65 or older") %&gt;% 
      group_by(X_state) %&gt;% summarise(count= n())
  
  ctall
  # A tibble: 53 x 2
     X_state              count
     &lt;fct&gt;                &lt;int&gt;
   1 Alabama               2411
   2 Alaska                 864
   3 Arizona               1578
   4 Arkansas              2069
   5 California            3111
   6 Colorado              4067
   7 Connecticut           2362
   8 Delaware              1786
   9 District of Columbia  1683
  10 Florida              14245
  # ... with 43 more rows
  </code></pre>