Hi
The answer to this will be blindingly obvious to someone, unfortunately not to me...
I am trying to replicate the tutorial example under 'reactivity overview'. If I have:
#server.r
library(shiny)
fib <- function(n) ifelse(n<3, 1, fib(n-1)+fib(n-2))
shinyServer(function(input, output) {
# OK, as long as this is called from the reactive world:
currentFib <- function() {
fib(as.numeric(input$n))
}
output$nth <- renderText({ currentFib })
})
#ui.r
library(shiny)
shinyUI(pageWithSidebar(
headerPanel("Reactivity"),
sidebarPanel(
selectInput("n","n",as.list(1:10))
),
mainPanel(
h4("toy"),
textOutput("nth")
)
))
Then I get an error: Error in cat(list(...), file, sep, fill, labels, append) : argument 1 (type 'closure') cannot be handled by 'cat'
If I add brackets () after currentFib, the app works as expected... is this a typo? Or am I making an elementary error...
Giles