output$openIntPlot <- renderPlot({
withProgress(message = 'waiting for plot', value = 0, {
if (!is.null(chain()))
getPlot(graphType(),chain(), stockText(), strikes(), lastQuote(), smoothOn(), pinByStrikes())
else
plotError("No Data. Either wrong date for this stock, or no prior data")
incProgress(0.9, detail = "outputing plot")
})
})
mainPanel(
h3(textOutput("caption")),
h5(textOutput("subCaption")),
plotOutput("openIntPlot"),
googleAnalytics()
)))
--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/cdf985e1-a7f4-4d70-b0a6-a10f6681dc4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/4d9f49d9-8302-4c08-ab3f-a9f24d21c086%40googlegroups.com.
Using 0.11.1 error with the installError in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :namespace ‘httpuv’ 1.3.0 is already loaded, but >= 1.3.2 is required
--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/1f32c23f-05d5-4ec0-99e7-0238723b4446%40googlegroups.com.
shinyServer(function(input, output, session) {
pinByStrikes <- reactive({input$pinByStrikes})
graphType <- reactive({input$graphType})
stockText <- reactive({toupper(input$stock)})
expText <- reactive({input$yymmdd})
strikes <- reactive({input$strikes})
smoothOn <- reactive({input$smoothOn})
withProgress(message = 'waiting for data', value = 0, {
lastQuote <- reactive({getQuote(stockText())$Last})
incProgress(0.2, detail = "got quote")
chain <- reactive({getYahooDataReformatted(stockText(), expText())})
incProgress(0.4, detail = "got options")
output$caption <- renderText({paste(stockText(), " $", lastQuote(), " Expiration ", expText())})
output$subCaption <- reactive({wasUpdatedToday(stockText(),chain(),expText())})
if (!is.null(chain)) reactive({cat("good option chain ", stockText(), expText(), "\n")})
incProgress(0.8, detail = "ready to plot")
})
output$openIntPlot <- renderPlot({
withProgress(message = 'waiting for plot', value = 0, {
if (!is.null(chain()))
p <- getPlot(graphType(),chain(), stockText(), strikes(), lastQuote(), smoothOn(), pinByStrikes())
else
plotError("No Data. Either wrong date for this stock, or no prior data")
if (doProgress) incProgress(0.9, detail = "outputting plot")
print(p)
})
})
})
Again when I remove the print(p) and just do the getPlot without the assignment is when I feel I get the problem. The hang occurs after the last incProgress(0.9, detail = "outputting plot"), so I was thinking it didn't matter what getPlot did, as that code ran fine. getPlot basically just figures out which plot to generate, sets up some parameters, and returns the ggplot. For the default the ggplot will be this:
p <- ggplot(openInt, aes(x=strike))
+ geom_area(aes(y = putOI, fill = "1 put", colour = "1 put", stat = "bin"), alpha = 0.5)
+ geom_area(aes(y = callOI, fill = "2 call",colour = "2 call", stat = "bin"), alpha = 0.5)
+ geom_point(aes(y=callOI), size=1.5, alpha=.5, color="blue")
+ geom_point(aes(y=putOI), size=1.5, alpha=.5, color="red")
+ scale_x_continuous(breaks = pretty(sp$lower:sp$upper, n = theN))
+ theme(legend.title = element_blank())
+ theme(axis.text.x=element_text(angle=90,size=theSize))
+ theme(panel.grid.minor.y = element_blank(), panel.grid.major.y = element_blank())
I can post all the code if you want. Or I can take out the print and redeploy the code. If there was some way of debugging what was happening during the hang this might be useful.
Thanks
David
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/a4844e7b-f40f-47b5-8075-2350bf61141b%40googlegroups.com.
library(shiny)
library(quantmod)
library(ggplot2)