title: Dplyr join on by=(a = b), where a and b are variables containing strings?
body: <p>I am trying to perform an inner join two tables using dplyr, and I think I'm getting tripped up by non-standard evaluation rules. When using the by=("a" = "b") argument, everything works as expected when "a" and "b" are actual strings. Here's a toy example that works:</p>
  
  <pre><code>library(dplyr)
  data(iris)
  
  inner_join(iris, iris, by=c("Sepal.Length" = "Sepal.Width"))
  </code></pre>
  
  <p>But let's say I was putting inner_join in a function:</p>
  
  <pre><code>library(dplyr)
  data(iris)
  
  myfn &lt;- function(xname, yname) {
      data(iris)
      inner_join(iris, iris, by=c(xname = yname))
  }
  
  myfn("Sepal.Length", "Sepal.Width")
  </code></pre>
  
  <p>This returns the following error:</p>
  
  <p><code>Error: cannot join on columns 'xname' x 'Sepal.Width': index out of bounds</code></p>
  
  <p>I suspect there is some fancy expression, deparsing, quoting, or unquoting that I could do to make this work, but I'm a bit murky on those details.</p>