title: position_dodge() does not seem to work with stat_summary() and x variables with different fill groups
body: <p>Using <code>stat_summary(geom = "bar) + stat_summary(geom = "errorbar")</code> does not seem to work with <code>position_dodge()</code>, in the case of <code>x</code> values with varying numbers of condition groups. </p>
  
  <p>I am trying to make a (what should be straightforward) barplot with <code>ggplot2</code>. My data has a number of different samples (x variable), and some of these samples also have a fill (<code>condition</code>) variable ("Scr" or "shRNA") while others don't (<code>condition = NA</code>). When I attempt to plot these data using the <code>stat_summary</code> wrappers to make bar plots with error bars, the <code>position_dodge</code> function for errorbars only works on samples that do not have different fill groups. The <code>stat_summary(geom = "barplot")</code> seems to be functional, because the separate bars do show up, but their error bars are not aligned. </p>
  
  <pre><code>test &lt;- data.frame(Sample = c(rep("A",6),rep("B",3)),
                     Target = c(rep("GENE1",9)),
                     val = c(1.1,1.2,1.15,.5,.6,.7,.95,1,1.05),
                     condition = c(rep("Scr",3),rep("shRNA",3),rep(NA,3)))
  
  
  
  g &lt;- ggplot(data=test,aes(x=Sample,y=val,fill=condition)) +
    stat_summary(geom = "bar", fun.y = mean,position = position_dodge2(width=.5,preserve = "single"),color="black",width=.8) +
    stat_summary(geom = "errorbar", fun.data = mean_se, position = position_dodge2(width=.2,preserve = "single"),width=.2) +
    scale_y_continuous(expand = expand_scale(mult = c(0,.2))) +
    #scale_fill_discrete(guide=guide_legend(title="",nrow=2))
  
  </code></pre>
  
  <p>I expect the <code>position_dodge()</code> argument in both <code>stat_summary()</code>'s to align error bars to the correct <code>x</code> position, regardless of whether or not that particular sample has one or two fill groups.</p>
  
  <p><a href="https://i.stack.imgur.com/Kjjz6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kjjz6.png" alt="enter image description here"></a></p>