title: R shiny custom function
body: <p>I'm trying to call a reactive function within my custom function and I couldn't. What is the best way to do this, here is the simplified code and I can't pass everything as a functional parameter because there will be too many to pass.</p>
  
  <pre><code>  library(shiny); 
    myf&lt;-function(){ return(psd()$y) }
    shinyApp( ui = textOutput("test2"), 
        server = function(input, output) {
            psd&lt;-reactive({ return(data.frame(x=10,y=30)) })
            output$test2 &lt;- renderText({ myf() })
          }
        )
  </code></pre>
  
  <p>This code generates an error : <code>Error in myf() : could not find function "psd"</code>
  What is the best way to call custom function which utilizes other function from within shinyserver?</p>