title: How to refer to a variable name with spaces?
body: <p>In <code>ggplot2</code>, how do I refer to a variable name with spaces?</p>
  
  <p>Why do <code>qplot()</code> and <code>ggplot()</code> break when used on variable names with quotes?</p>
  
  <p>For example, this works:</p>
  
  <pre><code>qplot(x,y,data=a)
  </code></pre>
  
  <p>But this does not:</p>
  
  <pre><code>qplot("x","y",data=a)
  </code></pre>
  
  <p>I ask because I often have data matrices with spaces in the name. Eg, "State Income". ggplot2 needs data frames; ok, I can convert. So I'd want to try something like:</p>
  
  <pre><code>qplot("State Income","State Ideology",data=as.data.frame(a.matrix))
  </code></pre>
  
  <p>That fails.</p>
  
  <p>Whereas in base R graphics, I'd do:</p>
  
  <pre><code>plot(a.matrix[,"State Income"],a.matrix[,"State Ideology"])
  </code></pre>
  
  <p>Which would work.</p>
  
  <p>Any ideas?</p>