title: Running prop.table on entire DF
body: <p>So I am trying to  run frequencies on a customer survey. The survey had 108 variables, and the responses are coded 1-5, with 9 being our NA. A few of the variables are text based. The raw data looks like this:</p>
  
  <pre><code>Q1 Q2 Q3 Q4
  1  3  2  Mazda
  2  3  4  Ford
  3  5  2  Toyota
  9  3  2  Hyundai
  </code></pre>
  
  <p>Ideally I want to know how many people responded to each question in this format for each of the 108 variables. For example, the first column in my new data frame would be:</p>
  
  <pre><code>Q1
  1  25%
  2  25%
  3  25%
  4  0%
  5  0%
  9  25%
  </code></pre>
  
  <p>I've tried using </p>
  
  <pre><code>Frequencies = apply(df, 2, table)
  </code></pre>
  
  <p>It spits it out as a list. I'd like to then run this list though </p>
  
  <pre><code>prop.table(Frequencies, 2)
  </code></pre>
  
  <p>to get the column percentages. However, I get the error "Error in margin.table(x, margin) : 'x' is not an array."</p>
  
  <p>I've played around for a few days with transforming Frequencies into a data frame but have had no luck. Any ideas?</p>
  
  <p>Thanks!</p>
  
  <p>PS: I've been working on this for four days and couldn't find a solution online. I'm sorry it's so basic. I'm very new at this.</p>