title: Calculating the proportions of Yes or No responses in R
body: <p>I am new to R and really trying to wrap my head around everything (even taking online course--which so far has not helped at all).</p>
  
  <p>What I started with is a large data frame containing 97 variables pertaining to compliance with regulations.</p>
  
  <p>I have created multiple dataframes based on the various geographic locations (there is probably an easier way to do it).</p>
  
  <p>In each of these dataframes, I have 7 variables I would like to find the mean of "Yes" and "No" responses. </p>
  
  <p>I first tried:</p>
  
  <pre><code>    summary(urban$vio_bag)
     Length     Class      Mode 
        398 character character
  </code></pre>
  
  <p>However, this just tells me nothing useful except that I have 398 responses.</p>
  
  <p>So I put this into a table:</p>
  
  <pre><code>urbanbag&lt;-table(urban$vio_bag)
  </code></pre>
  
  <p>This at least provided me with the number of Yes and No responses</p>
  
  <pre><code> Var1  Freq
  1 No   365
  2 Yes  30
  </code></pre>
  
  <p>So I then converted to a data.frame:</p>
  
  <pre><code>urbanbag = as.data.frame(urbanbag)
  </code></pre>
  
  <p>Then viewed it:</p>
  
  <pre><code> summary(urbanbag)
  
       Var1        Freq      
   No :1   Min.   : 30.0  
   Yes:1   1st Qu.:113.8  
           Median :197.5  
           Mean   :197.5  
           3rd Qu.:281.2  
           Max.   :365.0  
  </code></pre>
  
  <p>And the output still definitely did not help.. much more useless actually.
  I am not building these Matrices in R. It is a table imported from excel.</p>
  
  <p>I am just so lost and frustrated having spent days trying to figure out something that seems so elementary and googling help which did not work out.</p>
  
  <p>Is there a way to actually do this? </p>