title: Creating a percentage table
body: <p>I've created a table based of counts based on two columns in my data frame. I used:</p>
  
  <pre><code>data.frame(table(df$State,df$Subset)[,])
  </code></pre>
  
  <p>Is there a way I can turn these counts into percentages for each specific State?</p>
  
  <pre><code>             S1       S2        S3       S4    S5     S6     S7
  NY          195     1296       974     5528  3597    505    282
  NJ          172      733       763     3253  3088    315    166
  CA           48      552      1087     2073  1212   1149    203
  </code></pre>
  
  <p>So rather than counts, it each would be a percentage of each specific state. All NY would add up to 100% across, same with NJ, CA, etc..</p>