title: R shiny error: Cannot coerce type 'closure' to vector of type 'double'
body: <p>I would like to take in a vector of numbers as input and then simply plot the histogram. Here is my R code:</p>
  
  <p>ui.R:</p>
  
  <pre><code>library(shiny)
  
  shinyUI(pageWithSidebar(
  
    headerPanel("Hello Shiny!"),
  
    sidebarPanel(selectInput("Vector", "Select Numbers", c(1,2,3,4), selected = NULL, multiple = TRUE)),
  
    mainPanel( plotOutput("plotVector"))
  ))
  </code></pre>
  
  <p>Server.R:</p>
  
  <pre><code>library(shiny)
  shinyServer(function(input, output) {
  
  v&lt;- function()
   {
    v &lt;- rnorm(input$Vector)#take vector as input
  }
  
    output$plotVector &lt;- renderPlot({  hist(as.numeric(v))}) 
  
  })
  </code></pre>
  
  <p>code to run the app:</p>
  
  <pre><code>library(shiny)
  runApp("C:/Users/me/Desktop/R Projects/testShiny")
  </code></pre>
  
  <p>When I run this I am getting the error "Cannot coerce type 'closure' to vector of type 'double'"</p>
  
  <p>Can you help? Thank you.</p>