title: Shiny - Create reactive function from user string input
body: <p>I'm writing shiny app and I want to create mathematical functions from user input - There is textInput where user writes a function, e.g x^2, sin(x)+5 etc. Then, I want to plot this function so I have to concatenate string from textInput and 'function(x)' statement to get R function.   As far as I know, I need to have reactive variable which contains the R function. I came up with that:</p>
  
  <pre><code>func&lt;-reactive(
       bquote(function(x){ .(parse(text = input$fun)[[1]])}), quoted = TRUE
  )
  </code></pre>
  
  <p>where input$fun is id of textInput. This solution doesn't work and I have no other idea.</p>