Hello,
We have a confounding issue in the Shiny app that we are developing. As the subject indicates, we get an "error: subscript out of bounds" message upon running the app. However, when we isolate the offending code and run it on its own in RStudio, there is no error.
Please see the instructions below and the attached .R files for details. We are using Shiny version 0.8.0 and RStudio 0.98.501.
Is this a Shiny bug, or are we missing something?
Thanks,
Byran Smucker
----
To run the app, place ui.R and server.R (both attached) in a folder and run
library(shiny)
runApp("<folder path>")
It should produce a user interface with a button on the left, but on the right you will see "error: subscript out of bounds".
However, if just run the following three lines of code (lines 57-59 in server.R)
show=data.frame(ps=c(4,-1,0,1),ns=c(0,1,0,0),ts=c(45842,15653,28535,21656))
best.fit1=regsubsets(ts~ps+ns,data=show,nvmax=1)
pred1=predict.regsubsets(best.fit1,show,id=1) # line that offends Shiny
in RStudio (need to include the function "predict.regsubsets" - given at the beginning of server.R), then there are no errors.