title: ggplot2 column chart with facet_grid
body: <p>I'm trying to make a R <code>ggplot2</code> chart with columns grouping one variable, and a <code>facet_grid</code> to break down by another. Both ways I've tried have failed:</p>
  
  <p>1) Setting <code>x</code> as the <code>facet_grid</code> variable breaks down by that variable twice:</p>
  
  <pre><code>ggplot(diamonds, aes(x=cut, y=price, fill=color)) +
      geom_bar(position="dodge", stat="identity") +
      facet_grid(cut ~ ., scales="free")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/EZDNh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EZDNh.png" alt="enter image description here"></a></p>
  
  <p>2) Dropping <code>x</code> produces an error:</p>
  
  <pre><code>ggplot(diamonds, aes(y=price, fill=color)) +
      geom_bar(position="dodge", stat="identity") +
      facet_grid(cut ~ ., scales="free")
  # Error in exists(name, envir = env, mode = mode): 
  # argument "env" is missing, with no default
  </code></pre>