title: How to detect if bare variable or string
body: <p>I am trying to write a plotting function where you can pass bare column names to select which columns are plotted. I would like also to be able to specify a string as the color.</p>
  
  <p>I have found that I need to use shQuote if I want to pass a string to aes_string. Now my problem is to figure out if a bare name or a string was passed.
  How would I do this?</p>
  
  <pre><code>dat &lt;- data.frame(
      time = factor(c("Lunch","Dinner"), levels=c("Lunch","Dinner")),
      total_bill = c(14.89, 17.23)
  )
  
  
  
  plot_it &lt;- function(dat, x,y, fill){
      require(rlang)
      require(ggplot2)
  
      x &lt;- enquo(x)
      y &lt;- enquo(y)
      fill &lt;- enquo(fill)
  
      xN &lt;- quo_name(x)
      yN &lt;- quo_name(y)
      fillN &lt;- quo_name(fill)
  
  ggplot(data=dat, aes_string(x=xN, y=yN, fill=fillN)) +
      geom_bar(stat="identity")
  
  }
  </code></pre>
  
  <p>This works:</p>
  
  <pre><code>plot_it(dat, time, total_bill, time)
  </code></pre>
  
  <p>This does not:</p>
  
  <pre><code>plot_it(dat, time, total_bill, "grey")
  </code></pre>
  
  <p>Note that this requires the newest versions of rlang and ggplot2.</p>