title: How to use ggplot with prop.table(table(x)?
body: <p>First, I have a data with two categorical variables into like this: </p>
  
  <pre><code>nombre &lt;- c("A","B","C","A","D","F","F","H","I","J")
  sexo &lt;- c(rep("man",4),rep("woman",6))
  edad &lt;- c (25,14,25,76,12,90,65,45,56,43)
  pais &lt;- c(rep("spain",3),rep("italy",4),rep("portugal",3))
  
  data &lt;- data.frame(nombre=nombre,sexo=sexo,edad=edad,pais=pais)
  </code></pre>
  
  <p>If I use: </p>
  
  <pre><code>prop.table(table(data$sexo,data$pais), margin=1)
  </code></pre>
  
  <p>I can see the relative frequency of the levels, for example for <code>Italy</code> <code>(Man=0.25 Woman=0.5)</code></p>
  
  <p>but the problem is that when I try to plot the <code>prop.table(table(x))</code> I get something different</p>
  
  <pre><code>ggplot(as.data.frame(prop.table(table(data),margin=1)), aes(x=pais ,y =Freq, fill=sexo))+geom_bar(stat="identity")
  </code></pre>
  
  <p>On the <code>Y</code> axis from 0 to 3 and for example in the bar <code>Italy</code> <code>(Woman=2 Man=2.5)</code>
  I don't need that (and I don't know what is showing), I want the same with as I had with the table of the <code>prop.table(table(x))</code></p>
  
  <p>I think the problem is something related with the margin=1 </p>
  
  <p>Thanks you! </p>