title: remove quote of a string to make it as expression
body: <p>I want to pass a formula to a function, but I can not remove the double quote from the string of the formula. How could I do it? Thanks.</p>
  
  <pre><code>clust_start=c(1,100)
  i &lt;- 1 
  Lambexp &lt;- 1:99
  rank &lt;- 1:99
  alpha &lt;- 1:99
  d &lt;- 1
  b &lt;- 1:2
  ww=as.matrix(c(1:99), nrow=99)
  expression.logdens &lt;- paste(Lambexp[rank[(clust_start[i]:(clust_start[i + 1] - 1))]],         
  "*exp(", alpha[(clust_start[i]:(clust_start[i + 1] - 1))], " + bb*", ww[(clust_start[i]:    
  (clust_start[i + 1] - 1)), d], " - ", b[d]*ww[(clust_start[i]:(clust_start[i + 1] - 1)),     
  d], ")", sep="")  
  
  expr.formula &lt;- paste(expression.logdens, sep="", collapse=" + ")
  </code></pre>
  
  <p>I tried expr.formula &lt;- as.expression(expr.formula) and as.name(expr.formula), they didn't work. </p>
  
  <pre><code>logdens &lt;- function(bb){
      y &lt;- expr.formula    
          return(y)
      }
  logdens(1)
  </code></pre>