title: How to deal with spaces in column names?
body: <p>I know it is preferred if variable names do not have spaces in them. I have a situation where I need publication-quality charts, so axes and legends need to have properly formatted labels, ie with spaces. So, for example, in development I might have variables called "Pct.On.OAC" and Age.Group, but in my final plot I need "% on OAC" and "Age Group" to appear:</p>
  
  <pre><code>'data.frame':   22 obs. of  3 variables:
   $ % on OAC           : Factor w/ 11 levels "0","0.1-9.9",..: 1 2 3 4 5 6 7 8 9 10 ...
   $ Age Group          : Factor w/ 2 levels "Aged 80 and over",..: 1 1 1 1 1 1 1 1 1 1 ...
   $ Number of Practices: int  47 5 33 98 287 543 516 222 67 14 ...
  </code></pre>
  
  <p>But when I try to plot these:</p>
  
  <pre><code>ggplot(dt.m, aes(x=`% on OAC`,y=`Number of Practices`, fill=`Age Group`)) +
      geom_bar()
  )
  </code></pre>
  
  <p>no problem with that. But when I add a facet:</p>
  
  <pre><code>ggplot(dt.m, aes(x=`% on OAC`,y=`Number of Practices`, fill=`Age Group`)) +
      geom_bar() +
      facet_grid(`Age Group`~ .) 
  </code></pre>
  
  <p>I get <code>Error in</code>[.data.frame<code>(base, names(rows)) : undefined columns selected</code></p>
  
  <p>If I change <code>Age Group</code> to <code>Age.Group</code> then it works fine, but as I said, I don't want the dot to appear in the title legend.</p>
  
  <p>So my questions are:</p>
  
  <ol>
  <li>Is there a workaround for the problem with the facet ?</li>
  <li>Is there a better general approach to dealing with the problem of spaces (and other characters) in variable names when I want the final plot to include them ? I suppose I can manually overide them, but that seems like a lot of faffing around.</li>
  </ol>