title: How do I create a proportional bar chart in R per columns of a dataframe?
body: <p>I have a dataframe (<code>df</code>) structured as follows:</p>
  
  <pre><code>df &lt;- structure(list(header1 = structure(c(2L, 3L, 1L), .Label = c("bad", 
  "good", "so-so"), class = "factor"), header2 = structure(c(1L, 
  2L, 2L), .Label = c("bad", "good"), class = "factor"), header3 = structure(c(2L, 
  1L, 3L), .Label = c("bad", "good", "so-so"), class = "factor")), class = "data.frame", row.names = c(NA, 
  -3L))
  </code></pre>
  
  <p>I've been trying to use <code>plot_stackfrq</code> from the <code>sjPlot</code> package to produce a proportional bar chart.  Note that the <code>header2</code> column is missing any 'so-so' values (only header1 and header3 have <code>so-so</code> values). I've tried, but the colors in the resulting proportional bars are not displayed correctly. The color corresponding to <code>so-so</code>  in <code>header1</code> and <code>header3</code> is presented as the color corresponding to <code>good</code> in columns 'header2'.  </p>
  
  <p>Does anyone have a solution for this using <code>sjPlot</code> or any other R library that can create a proportionate bar chart for each column? </p>