title: How to add labels as percentages to the lattice stacked bar charts in R?
body: <p>I have created some stacked bar charts with the <code>likert</code> function from the <code>HH</code> package, that uses <code>lattice</code>. Now I want to add <strong>labels represented as percentages</strong> inside to each segment of the charts, or, better, only to that segments that have a sufficient width for that. How to do this? I mention that my data are represented as frequencies, not as percentages.</p>
  
  <p><strong>My data</strong>:</p>
  
  <pre><code>ssb &lt;- structure(list(`Strongly Disagree` = c(2L, 1L), `Moderate Disagree` = 1:2, 
      `Slightly Disagree` = c(3L, 1L), `Slightly Agree` = c(1L, 
      5L), `Moderate Agree` = 4:5, `Strongly Agree` = c(9L, 6L), 
      Grup = c("Experimental grup", "Control grup")), .Names = c("Strongly Disagree", 
  "Moderate Disagree", "Slightly Disagree", "Slightly Agree", "Moderate Agree", 
  "Strongly Agree", "Grup"), row.names = c("1", "2"), class = "data.frame")
  </code></pre>
  
  <p><strong>My code</strong>:</p>
  
  <pre><code>library(HH)
  ppi &lt;- 150
  jpeg("ssb_%02d.jpg", width=7*ppi, height=4*ppi, res=ppi)
  
  plot_obj &lt;- likert(Grup ~ . | Grup, data = ssb, as.percent = TRUE, positive.order = TRUE,
      main="", xlab=list(label="Percent", cex=1.1),
      ylab="", ylab.right = list("Subjects per group", cex=1.1),
      scales = list(y = list(relation = "free", labels=""), cex=1.1),
      layout = c(1, 2), auto.key=list(space="bottom", columns=3, title="", cex=1.1))
  
  print(plot_obj)
  
  dev.off()
  </code></pre>