title: How to use a character as attribute of a function
body: <p>I want to run a multiple comparisons analysis for the different variables of a model. My idea is as follows:</p>
  
  <pre><code>library(multcomp)
  set.seed(123)
  x1 &lt;- gl(4,10)
  x2 &lt;- gl(5,2,40)
  y &lt;- rnorm(40)
  
  fm1 &lt;- lm(y ~ x1 + x2)
  
  for(var in c('x1', 'x2'))
  {
  mc1 &lt;- glht(fm1, linfct=mcp(var='Tukey'))
  print(summary(mc1))
  }
  </code></pre>
  
  <p>When I run, I get the following error:
  <code><pre>Error en mcp2matrix(model, linfct = linfct) : 
      Variable(s) ‘var’ have been specified in ‘linfct’ but cannot be found in ‘model’! 
  </code></pre></p>
  
  <p>That is, it is not possible to use a character to specify an attribute of the mcp function.
  Anyone knows a solution?</p>