title: R ggplot geom_bar Error: Discrete value supplied to continuous scale
body: <p>I have proportion response data for 4 experimental groups, with 2 different statistics computed for each group. I want the following figure (which I can achieve):</p>
  <p><a href="https://i.stack.imgur.com/oHCIO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oHCIO.png" alt="enter image description here" /></a></p>
  <p>I obtain this figure with the following code:</p>
  <pre><code>Group&lt;-c('a','b','c','d','a','b','c','d')
  Statistic&lt;-c('Mean','Mean','Mean','Mean','d','d','d','d')
  Val&lt;-c(.75,.83,.79,.69,.5,.02,.1,.3)
  dfm2&lt;-data.frame(cbind(Group,Statistic,Val)) 
  ggplot(dfm2,aes(x = Group,y = Val)) +    
   geom_bar(aes(fill = Statistic),position = dodge',stat='identity')
  </code></pre>
  <p>However, when I change the limits of the y-axis (to [0,1] since I have proportions) by adding the line of code:</p>
  <pre><code>+ scale_y_continuous(limits=c(0, 1))
  </code></pre>
  <p>I get</p>
  <blockquote>
  <p>Error: Discrete value supplied to continuous scale</p>
  </blockquote>
  <p>So I understand this means I have a non-continuous variable. I have tried converting my Statistic variable by using <code>as.numeric()</code> and countless other options but to no avail.  If anyone can assist me in solving this problem and/or explain what causes it, I would be most appreciative.</p>