r - ggplot renders in shiny app but not on shinyapps.io, no errors or warnings -


the shiny app in question 250 lines of code, try copy relevant snippets below, may impractical produce working example reproduces issue having.

when run shiny app, runs flawlessly locally. when deploy shinyapps.io, receive success messages , no errors or warnings. however, when view shinyapps.io in browser none of valueboxes or ggplots visible.

i suspect issue memory (the dataset 500k rows). maybe shiny apps server running out of memory before loads? again, no warnings, errors, or relevant messages on logs (or on deploy tab when deploying app shinyapps.io).

in ui, have these rows showing various plots , value boxes:

                  #value boxes show numeric stats                   fluidrow(                     valueboxoutput("comp_fare"),                     valueboxoutput("num_comp_fares"),                     valueboxoutput("num_aa_fares")                   ),                    br(),                   h2("impact of continuous features on fares"),                    #select continuous variables                   fluidrow(                     column(selectinput(inputid = "continuous_variable",                                 label = "choose variable compare: ",                                 choices = df %>%                                    select_if(is.numeric) %>% select(-fare) %>%                                    names,                                 selected = "distance"                     ), width = 6),                     column(selectinput(inputid = "fit_method",                                 label = "choose fit method: ",                                 choices = c("linear", "quadratic"),                                 selected = "linear"                     ), width = 6)                   ),                    br(),                    #plot continuous variables                   fluidrow(                     plotoutput("cont_plot")                   ),                    br(),                   h2("impact of discrete features on fares"),                    #select factor variables                   fluidrow(                     column(selectinput(inputid = "factor_variable",                                 label = "choose variable compare: ",                                 choices = df %>%                                    select_if(is.factor) %>%                                    names,                                 selected = "hub_airport"                     ), width = 6),                     column(selectinput(inputid = "display_layout",                                        label = "choose display layout: ",                                        choices = c("fill", "dodge"),                                        selected = "dodge"                     ), width = 6)                   ),                    br(),                    #plot factor variables                   fluidrow(                     plotoutput("cat_plot")                   ),  #server code  #valueboxes   output$comp_fare <- rendervaluebox({ valuebox(competitor_fare_difference(),          "difference in competitor fare",          icon = icon("dollar"),          color = "yellow")    })  output$cont_plot <- renderplot({ ggplot() +   geom_smooth(data = df2(),                aes_string(input$continuous_variable, "fare", color = "carrier"),                method = "lm",               formula = y ~ poly(x, fit_method())) +   geom_point(data = sample_n(df2(), 1000),               aes_string(input$continuous_variable, "fare", color = "carrier"),               alpha = .3) +   theme_bw() +   scale_y_continuous(labels = dollar) +   labs(title = paste0("comparison of american airlines , ", input$competitor),        x = input$continuous_variable,        y = "round-trip fare ($us)"        ) %>% print   }) 

the issue available memory on shinyapps.io server. sampled dataset smaller , ran fine. if else experiences this, saw no errors or warnings, failure load. hope helps else!!


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -