title: Call the UI of R built-in functions
body: <p>I want to be able to design a set of UI that can call R's built-in functions, but the current problem lies in the data selection when calling the function. I need to return the calculation result of a function to my UI interface so that another function can be arbitrary Select the variables in the current environment as the input of the function. This is my current code. Can anyone give me some suggestions or some cases?</p>
  <pre><code>library(shiny)
  function_choose = c(&quot;sin&quot;,&quot;cos&quot;) 
  
  
  
  ui &lt;- fluidPage(
    selectInput('f', 'function_choose', function_choose,
                  selected = function_choose[[1]]),
    sidebarPanel(
      conditionalPanel(condition = &quot;input.f=='sin'&quot;,
                       mainPanel(
                         selectInput('sin_dat','data',c(&quot;I want to show all the variables in the workspace here &quot;)),
                         actionButton(inputId = &quot;sin_run&quot;,label = &quot;RUN&quot;)
                       )
      ),
      conditionalPanel(condition = &quot;input.f=='cos'&quot;,
                       mainPanel(
                         selectInput('workspace','data',c(&quot;I want to show all the variables in the workspace here &quot;))),
                         actionButton(inputId = &quot;cos_run&quot;,label = &quot;RUN&quot;)
      )
    ),
    mainPanel(
      textOutput(&quot;text&quot;)
    )
    
  )
  
  server &lt;- function(input, output,session) {
    data &lt;- c(0.1,0.2,0.3)
    
    observeEvent(input$sin_run,{
      data_sined &lt;- sin(data)
      output$text &lt;- renderText({
        &quot;data_sined is created&quot;
      })
    })
    
    observeEvent(input$cos_run,{
      data_cosed&lt;- cos(data)
      output$text &lt;- renderText({
        &quot;data_cosed is created&quot;
      })
    })
  
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>