Hi everyone,
I am relatively new to Shiny, but I'm working under a tight deadline and I'm very stuck. I am getting the error message "cannot coerce type 'closure' to vector of type 'any'." Can anyone give me insight into what this means? For more background, I am running a SIR epidemic model, which requires the desolve package. This seems to be the section of code that's giving me trouble (in my server component). I am not sure exactly where the problem is, but any help would be greatly appreciated.
times <- seq(0, 150, by = 1)
out <-reactive({
out<-renderDataTable(ode(y= init, times = times, func = sirvac, parms = parameters))
})
output$curves<- renderPlot({
matplot(times, out(), type = "l", xlab = "Time", ylab = "Susceptibles and Recovereds", main = "SIR Model", lwd = 1, lty = 1, bty = "l", col = 2:4)
legend(40, 0.7, c("Susceptibles", "Infecteds", "Recovereds"), pch = 1, col = 2:4)
})
Thank you!!
-Emily