My app won't deploy correctly

I am having difficulty deploying my app correctly. The app deploys quite alright; I don't get any error message, but it does not deploy the correct app. Below is the app I want to deploy:

But after deploying, this is what I see:

Can somebody please help me figure out what is going on? I have downloaded and installed the rsconnect package, as well as the IDE and curl packages. What could still be wrong? Is there a package I am still missing? I would really appreciate a suggestion please.

I have never encountered this sort of problem publishing an application. I have installed reconnect, PKI, and packrat packages, but the problem persists. I even created a new account in shiny.io, but there is no difference. I would really appreciate some advice right now.

Hello guys, please I am still on this issue about my app not deploying the right app, or deploying the app correctly. I ran a diagnostic, but looking through, I can't seem to make out where the problem lies. Here is the diagnosis log report:

----- Deployment log started at  2020-05-10 15:21:28  -----
Deploy command: 
 rsconnect::deployApp(appDir = "~/mavisanalytics", appFileManifest = "C:/Users/Idiaye/AppData/Local/Temp/41ba-eb9a-eed4-89df",      appPrimaryDoc = "mavisanalytics.R", account = "mavisanalytic",      server = "shinyapps.io", appName = "mavisanalytic", appTitle = "mavisanalytic",      launch.browser = function(url) {         message("Deployment completed: ", url)     }, lint = FALSE, metadata = list(asMultiple = FALSE, asStatic = FALSE),      logLevel = "verbose") 

Session information: 
R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8.1 x64 (build 9600)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252 
[2] LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.0   rsconnect_0.8.16
Cookies: 
[1] "None"
GET /v1/applications/?filter=account_id:521782&filter=name:mavisanalytic&count=100&offset=0 1339ms
----- Bundle upload started at  2020-05-10 15:21:31  -----
[2020-05-10 15:21:31] Inferring App mode and parameters 
[2020-05-10 15:21:31] Bundling app dir 
[2020-05-10 15:21:32] Generate manifest.json 
[2020-05-10 15:25:49] Writing Rmd index if necessary 
[2020-05-10 15:25:49] Compressing the bundle 
POST /v1/bundles 5399ms
[2020-05-10 15:26:02] Starting upload now 
PUT /bundles/application-2244614/81faa60b5cd44f69a743e8b125647c9c.tar.gz?AWSAccessKeyId=ASIA54P7SCTK7HP673IH&x-amz-acl=bucket-owner-full-control&Expires=1589124376&content-md5=coG%2BPby5ZsGxhhF%2B9CeNiA%3D%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEMn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIQCTrMOemWfSSl%2BzjukGiq7%2F89q%2Be8iF5shZ7Q3UWZjEHQIgIBPKbKAqJnQS1zM9AsgAxOQrEoSVuQnGcdBcOx8pG5IqtAMIEhAAGgw5NTQ1NTU1NjkzNjUiDKJ8MkOG8xuYzttSSyqRA9aqsCh0A76Uf4phoPnXerOVq%2FxJDSW5zKMHBh1R0T27XfQDLIMV8L%2BtT%2B8SJJQOilLUaTVex7kvZRgVX6ROea5Z39im9142pMwtvvneCKvaJwHX21HCSC9M5opHfNU9i7Nm3k%2BdqtTdD0ayLlmaSbKD4UlBD8uCWu84Z15OCyssTswbjeHyyTCzNsnFwt%2FzV5YW%2FrlCumBLf2%2F%2BxGmVmxu1p2J3qVDVCPf9BpoaoPbpgkI1uWqgxYy4%2FH8FwMtpwBUSQeGU%2FWNkXIG71q7FSHwY%2FEH2YkIoYhT9yQGj8ckPLU7WBj%2B75Ndq%2B3lbpSyMpYLY8I%2FZGcrT88nlE7ZYrFZ3us%2B7ZxyU5y8vHhqUXubCbC4MRZbklxKgYOZ8dHgB1OdBZnaxftevm1FGeH%2FyBTkL7exEZKPP7hcNGI4BUgz6nBCgsGMP1tBKfRSZ4lKXV0bTW%2Fh2axZB0BVrSC7MWClVHHS2AZ9KK39%2BygzE5u5Hmhmh7xp%2BBzU8lkDrgrR%2Bg%2BEhKCS%2BaqzNDR7V%2FiDkBdbmMIv03vUFOusBf%2BIK9IoQi7fVm1%2B0OpLncbkG%2BZvfFjXfOE4u0PwX6Mb41NfdNh2EjN2dyMKHTngBrs%2BKp5By0xvkDY9G2MdIW12PZGK8MFnYNsiFj88AaX3ulVCo5GlqMfg%2BgZmwkR72KiG%2BCR2h%2F5rDWgO%2BPQORH8TL8ISHKeaKyr9q9zNN5oQMxVXGefmwIm0EtN4JjroQQnBcgyyGrYNNMITWxjj6HajjbYgjTbs6KjWd336CcrU%2F%2BdOapWzuCw%2BfEQVSQ127Jx8xfNgfZ5LbBEZ5rCn3mFegaAU7O6dHjV1o4An4Zz166HfG47qbMFOTlQ%3D%3D&Signature=1KB4IEiuY8lxrDccz2JpQI%2BPTE8%3D&content-type=application%2Fx-tar 237580ms
[2020-05-10 15:30:00] Upload complete 
POST /v1/bundles/3127826/status 1399ms
GET /v1/bundles/3127826 1180ms
[2020-05-10 15:30:03] Saving deployment record for mavisanalytic -  
----- Server deployment started at  2020-05-10 15:30:03  -----
POST /v1/applications/2244614/deploy 1360ms
Waiting for task: 729106616
GET /v1/tasks/729106616 1280ms
  building: Parsing manifest
GET /v1/tasks/729106616 1219ms
  building: Building image: 3490965
GET /v1/tasks/729106616 1190ms
  building: Installing system dependencies
GET /v1/tasks/729106616 1359ms
GET /v1/tasks/729106616 1170ms
  building: Fetching packages
GET /v1/tasks/729106616 1740ms
  building: Installing packages
GET /v1/tasks/729106616 1500ms
GET /v1/tasks/729106616 1610ms
GET /v1/tasks/729106616 1539ms
GET /v1/tasks/729106616 1279ms
GET /v1/tasks/729106616 1179ms
GET /v1/tasks/729106616 1180ms
GET /v1/tasks/729106616 1240ms
GET /v1/tasks/729106616 1170ms
GET /v1/tasks/729106616 1250ms
GET /v1/tasks/729106616 1230ms
GET /v1/tasks/729106616 1179ms
GET /v1/tasks/729106616 1189ms
GET /v1/tasks/729106616 1220ms
GET /v1/tasks/729106616 1179ms
GET /v1/tasks/729106616 1189ms
  building: Installing files
GET /v1/tasks/729106616 1139ms
GET /v1/tasks/729106616 1169ms
  building: Pushing image: 3490965
GET /v1/tasks/729106616 1250ms
GET /v1/tasks/729106616 1180ms
GET /v1/tasks/729106616 1179ms
GET /v1/tasks/729106616 1209ms
GET /v1/tasks/729106616 1159ms
GET /v1/tasks/729106616 1230ms
GET /v1/tasks/729106616 1189ms
GET /v1/tasks/729106616 1179ms
GET /v1/tasks/729106616 1180ms
GET /v1/tasks/729106616 1190ms
GET /v1/tasks/729106616 1179ms
GET /v1/tasks/729106616 1190ms
  deploying: Starting instances
GET /v1/tasks/729106616 1190ms
  rollforward: Activating new instances
GET /v1/tasks/729106616 1209ms
  success: Stopping old instances
----- Deployment log finished at  2020-05-10 15:31:31  -----
Deployment completed: https://mavisanalytic.shinyapps.io/mavisanalytic/

Please, I desperately need to be able to deploy this app.

Again, I tried to deploy the app; and this time, I got the following error message in my console:

Error in curl::curl_fetch_memory(url, handle = handle) : 
  Timeout was reached: [api.shinyapps.io] Resolving timed out after 10000 milliseconds
Timing stopped at: 8.34 0.84 12.53
1 Like

My shiny app runs very well in rstudio, but does not deploy well in shinyapps.io. I discovered that while uploading of bundle gets done, deploying of bundle is never completed. Here is the log from deployment:


Preparing to deploy application...DONE
Uploading bundle for application: 2244614...DONE
Deploying bundle: 3143286 for application: 2244614 ...
Waiting for task: 730931468
  building: Parsing manifest
  building: Building image: 3509174
  building: Installing system dependencies
  building: Fetching packages
  building: Installing packages
  building: Installing files
  building: Pushing image: 3509174
  deploying: Starting instances
  rollforward: Activating new instances
  terminating: Stopping old instances
Application successfully deployed to https://mavisanalytic.shinyapps.io/mavisanalytic/

When I ran the appDependencies() code, I got the following list of dependencies:


 rsconnect::appDependencies(appDir= "mavisanalytics")
              package  version source
1                  BH 1.72.0-3   CRAN
2                MASS 7.3-51.6   CRAN
3              Matrix   1.2-18   CRAN
4                 NLP    0.2-0   CRAN
5                  R6    2.4.1   CRAN
6        RColorBrewer    1.1-2   CRAN
7                Rcpp  1.0.4.6   CRAN
8   SentimentAnalysis    1.3-3   CRAN
9             askpass      1.1   CRAN
10         assertthat    0.2.1   CRAN
11          backports    1.1.6   CRAN
12              callr    3.4.3   CRAN
13                cli    2.0.2   CRAN
14          codetools   0.2-16   CRAN
15         colorspace    1.4-1   CRAN
16             crayon    1.3.4   CRAN
17               curl      4.3   CRAN
18         data.table   1.12.8   CRAN
19               desc    1.2.0   CRAN
20             digest   0.6.25   CRAN
21              dplyr    0.8.5   CRAN
22                dtt    0.1-2   CRAN
23           ellipsis    0.3.0   CRAN
24            english    1.2-5   CRAN
25           evaluate     0.14   CRAN
26              fansi    0.4.1   CRAN
27             farver    2.0.3   CRAN
28            fastmap    1.0.1   CRAN
29            foreach    1.5.0   CRAN
30            ggplot2    3.3.0   CRAN
31             glmnet    3.0-2   CRAN
32               glue    1.4.0   CRAN
33             gtable    0.3.0   CRAN
34          htmltools    0.4.0   CRAN
35        htmlwidgets    1.5.1   CRAN
36             httpuv    1.5.2   CRAN
37            isoband    0.2.1   CRAN
38          iterators   1.0.12   CRAN
39           jsonlite    1.6.1   CRAN
40           labeling      0.3   CRAN
41               lars      1.2   CRAN
42              later    1.0.0   CRAN
43            lattice  0.20-38   CRAN
44            lexicon    1.2.1   CRAN
45          lifecycle    0.2.0   CRAN
46           magrittr      1.5   CRAN
47               mgcv   1.8-28   CRAN
48              mgsub    1.7.1   CRAN
49               mime      0.9   CRAN
50            moments     0.14   CRAN
51            munsell    0.5.0   CRAN
52            ngramrr    0.2.0   CRAN
53               nlme  3.1-139   CRAN
54            openssl    1.4.1   CRAN
55            packrat    0.5.0   CRAN
56             pillar    1.4.4   CRAN
57           pkgbuild    1.0.8   CRAN
58          pkgconfig    2.0.3   CRAN
59            pkgload    1.0.2   CRAN
60              plogr    0.2.0   CRAN
61             praise    1.0.0   CRAN
62        prettyunits    1.1.1   CRAN
63           processx    3.4.2   CRAN
64           promises    1.1.0   CRAN
65                 ps    1.3.2   CRAN
66              purrr    0.3.4   CRAN
67   qdapDictionaries    1.0.7   CRAN
68          qdapRegex    0.7.2   CRAN
69       randomForest   4.6-14   CRAN
70             reactR    0.4.2   CRAN
71          reactable  0.1.0.1   CRAN
72              rlang    0.4.6   CRAN
73          rprojroot    1.3-2   CRAN
74          rsconnect   0.8.16   CRAN
75         rstudioapi     0.11   CRAN
76             scales    1.1.0   CRAN
77              shape    1.4.4   CRAN
78              shiny  1.4.0.2   CRAN
79       shinyWidgets    0.5.1   CRAN
80         shinyalert      1.1   CRAN
81    shinycssloaders      0.3   CRAN
82            shinyjs      1.1   CRAN
83        shinythemes    1.1.2   CRAN
84               slam   0.1-47   CRAN
85        sourcetools    0.1.7   CRAN
86          spikeslab    1.1.5   CRAN
87         stringdist  0.9.5.5   CRAN
88            stringi    1.4.6   CRAN
89                sys      3.3   CRAN
90            syuzhet    1.0.4   CRAN
91                tau   0.0-21   CRAN
92           testthat    2.3.2   CRAN
93          textclean    0.9.3   CRAN
94          textshape    1.7.1   CRAN
95             tibble    3.0.1   CRAN
96              tidyr    1.0.2   CRAN
97         tidyselect    1.0.0   CRAN
98                 tm    0.7-7   CRAN
99               utf8    1.1.4   CRAN
100             vctrs    0.2.4   CRAN
101       viridisLite    0.3.0   CRAN
102             withr    2.2.0   CRAN
103              xml2    1.3.2   CRAN
104            xtable    1.8-4   CRAN
105              yaml    2.2.1   CRAN
106               zoo    1.8-8   CRAN

Is there still something I am missing?

Have you tried deleting the app from your account and deploying again? That should clear any cache that could be causing this issue.

I have tried that a number of times, but the problem persists

Do you have more than one account linked to RStudio? Have you make sure you are deploying to the expected account? I suspect this is a misconfiguration rather than a technical issue.

Yes, I have 3 accounts on shinyapps.io, but I have tried mostly to deploy the app to my 'mavisanalytic' account

I tried deploying the app again to my 'mavisanalytic' account on shinyapps.io. Now I have the following error message in my browser after deployment:


# An error has occurred

The application failed to start (exited with code 1).

`Error in value[[3L]](cond) : object 'server' not found
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted`

Could you check what your app's logs say?

Can you show your code or even better a reproducible example?

Hi Adresrcs, here is my shiny app code. It's a little messy though:

if(interactive()){
    library(shiny)
    library(shinyalert)  
    library(shinycssloaders)  
    library(shinythemes)
    library(shinyWidgets)
    library(shinyjs)  
    library(SentimentAnalysis)
    library(textclean)
    library(reactable)
    library(rsconnect)
    library(curl)  
    library(tm)  
    
    options(spinner.color="#3498db",
            spinner.color.background="#ffffff",
            spinner.size=1)  
    
    ui<-list(useShinyjs(),navbarPage(strong("Mavis Analytic"),theme=shinytheme("cerulean"),
                                     windowTitle="Mavis Analytic",fluid=TRUE,inverse=FALSE,
                                     tabPanel(strong("Opinion Miner"),icon=icon("table"),useShinyalert(),
                                              setBackgroundColor("white"),setBackgroundImage(src="white.jpg"),        
                                              sidebarLayout(
                                                  sidebarPanel(width=3,
                                                               img(src="logo.jpg",height=130,width=150),
                                                               h4(strong("Enter your texts in these fields")),
                                                               actionButton("clear",strong("Clear Fields"),icon=icon("broom")),br(),br(),
                                                               textAreaInput("text","Text Field 1",value="It is a beautiful day"),
                                                               textAreaInput("texts","Text Field 2",value="I am happy to be here"),
                                                               textAreaInput("word","Text Field 3",value="Let's have some fun"),
                                                               textAreaInput("words","Text Field 4",value="It has been a bad outing"),
                                                               textAreaInput("wordy","Text Field 5",value="I dislike clowns"),
                                                               actionButton("run",strong("Run Analysis"),icon=icon("caret-right")),br(),hr(),h5(strong("The number of words entered into each text field:")),reactableOutput("count",width="40%")),
                                                  mainPanel(h4("The Opinion Miner is a tool for conducting sentiment analysis. It is useful for analyzing and scoring the kinds of sentiments expressed in texts, such as in literature, social media posts, or product reviews."),hr(),h3(strong("Table of Sentiment Scores")),withSpinner(reactableOutput("table"),type=1),downloadButton("download",strong("Download Table")),br(),br(),
                                                            column(4,selectInput("choice","Select Sentiment Score to Plot",choices=c("QDAP","LoughranM","HarvardIV"))),column(4,selectInput("color","Select Color",choices=c("Blue","Red","Green","Yellow","Purple"))),
                                                            fluidRow(column(6,withSpinner(plotOutput("plot",height=350,width=400),type=1)),column(6,withSpinner(plotOutput("graph",height=350,width=400),type=1))),
                                                            fluidRow(column(6,downloadButton("plot.down",strong("Download Graph"))))))),
                                     
                                     tabPanel(strong("Financial Ratios Calculator"),icon=icon("chart-bar"),
                                              sidebarLayout(
                                                  sidebarPanel(width=2,h4(strong("Profit figures:")),
                                                               actionButton("delete",strong("Clear Fields"),icon=icon("broom")),br(),br(),  
                                                               textInput("num","Profit 1",value="100000",width=150),
                                                               textInput("numb","Profit 2",value="150000",width=150),
                                                               textInput("number","Profit 3",value="200000",width=150),
                                                               textInput("numbers","Profit 4",value="250000",width=150),
                                                               textInput("numbered","Profit 5",value="300000",width=150),
                                                               hr(),
                                                               h4(strong("Turnover figures:")),
                                                               actionButton("remove",strong("Clear Fields"),icon=icon("broom")),br(),br(),
                                                               textInput("fig","Turnover 1",value="350000",width=150),
                                                               textInput("figs","Turnover 2",value="300000",width=150),
                                                               textInput("figu","Turnover 3",value="420000",width=150),
                                                               textInput("figur","Turnover 4",value="600000",width=150),
                                                               textInput("figure","Turnover 5",value="550000",width=150),
                                                               actionButton("go",strong("Calculate Ratio"),icon=icon("caret-right")),
                                                               hr(),
                                                               h4(strong("Receivables figures:")),
                                                               actionButton("vanish",strong("Clear Fields"),icon=icon("broom")),br(),br(),
                                                               textInput("deb","Receivables 1",value="150000",width=150),
                                                               textInput("debt","Receivables 2",value="100000",width=150),
                                                               textInput("debts","Receivables 3",value="50000",width=150),
                                                               textInput("debtor","Receivables 4",value="80000",width=150),
                                                               textInput("debtors","Receivables 5",value="170000",width=150),
                                                               actionButton("away",strong("Calculate Ratio"),icon=icon("caret-right"))),  
                                                  mainPanel(h4("The Financial Ratios Calculator makes possible a comparative analysis of a company's profitability and efficiency ratios over time."),hr(),
                                                            h3(strong("Profitability Ratios")),h4("(Profit/Turnover): Calculates how much profit margin (%) a company makes on its sales"),fluidRow(column(6,withSpinner(plotOutput("bar",),type=1)),column(6,withSpinner(plotOutput("pie"),type=1))),
                                                            fluidRow(column(6,downloadButton("drop",strong("Download Bar Plot"))),column(6,downloadButton("fall",strong("Download Pie Chart")))),hr(),
                                                            h3(strong("Efficiency Ratios")),h4("(Receivables/Turnover): Calculates the average length of time (in days) it takes for a company to recover its debts"),
                                                            fluidRow(column(6,withSpinner(plotOutput("sphere"),type=1)),column(6,withSpinner(plotOutput("bin"),type=1))),
                                                            fluidRow(column(6,downloadButton("down",strong("Download Pie Chart"))),column(6,downloadButton("plummet",strong("Download Bar Plot")))))
                                                  
                                                  
                                              )),
                                     tabPanel(strong("About Mavis Analytic"),icon=icon("info"),mainPanel(h4(div(style="color:#5499c7","Mavis Analytic is designed as a multi-functional web application, with a variety of features that make it a modern business tool.
                                                                                                                    It currently incorporates tools for conducting sentiment analysis and financial performance evaluation. The goal of the designers of Mavis Analytic, Mavis Naissance Consulting,
                                                                                                                    is to keep expanding the scope of the application, by creating more functions that will make it a very versatile software for a wide range of business uses. ")),img(src="New.jpg",height=150,width=150))),
                                     tabPanel(strong("Send Us Your Feedback"),icon=icon("envelope"),
                                              HTML("<iframe src=https://docs.google.com/forms/d/e/1FAIpQLSex-eKi33LdmZE7L3PwjWm4tFbFoEIw_L_KUvsSi6kgdXgJPA/viewform?embedded=true width=1400 height=1000 frameborder=0 marginheight=0 marginwidth=0>Loading.</iframe>")),
                                     navbarMenu(strong("More"),
                                                tabPanel(strong("Graphs and Charts"),icon=icon("chart-bar"),sidebarLayout(sidebarPanel(width=3, selectInput("select","Select Variable to Plot",choice=c(
                                                    "Indegree","Outdegree","Degree","Normalized",
                                                    "Domain","Proximity","Modularity","Clusters"
                                                ),selected="Modularity"),sliderInput("slide","Change Pie Chart Angle",min=45,max=180,animate=TRUE,value=45,step=1)),
                                                
                                                mainPanel(fluidRow(column(6,plotOutput("draw")),column(6,plotOutput("art"))),br(),
                                                          fluidRow(column(6,plotOutput("paint")),column(6,plotOutput("part")))))),
                                                
                                                tabPanel(strong("Tables"),icon=icon("table"),
                                                         mainPanel(h3("Network data pulled from Twitter interactions on different subjects "),actionButton("detail",strong("Table Info")),downloadButton("table.down",strong("Download Table")),reactableOutput("metrics.table"),hr(),
                                                                   actionButton("more",strong("Table Info")),downloadButton("flat",strong("Download Table")), reactableOutput("freedom.table"))),
                                                tabPanel(strong("Library"),icon=icon("file-pdf"),
                                                         fluidRow(column(6,tags$iframe(style="height:400px;width:100%;scrolling=yes",src="analysis.pdf")),column(6,tags$iframe(style="height:400px;width:100%;scrolling=yes",src="Audits.pdf"))),br(),
                                                         fluidRow(column(6,tags$iframe(style="height:400px;width:100%;scrolling=yes",src="pricing.pdf")),column(6,tags$iframe(style="height:400px;width:100%;scrolling=yes",src="tech.pdf")))))
                                     
    ))
    server<-function(input,output,session){
        
        observeEvent(input$clear,{
            updateTextAreaInput(session,"text",value="",placeholder="Enter new text")
            updateTextAreaInput(session,"texts",value="",placeholder="Enter new text")
            updateTextAreaInput(session,"word",value="",placeholder="Enter new text")
            updateTextAreaInput(session,"words",value="",placeholder="Enter new text")
            updateTextAreaInput(session,"wordy",value="",placeholder="Enter new text")
            
        })
        
        observeEvent(input$run,{
            shinyalert(title="Running Analysis",text="Please be patient while the app cleans the texts and runs the analysis",
                       closeOnEsc=TRUE,confirmButtonText="OK",timer=10000,animation=TRUE,closeOnClickOutside=TRUE)
        })
        
        observeEvent(input$detail,{
            shinyalert(title="Disease on Twitter",text="This table contains the metrics underlying the network of Twitter interactions about disease, using the #disease hashtag",
                       closeOnEsc=TRUE,closeOnClickOutside=TRUE,animation=TRUE,confirmButtonText="OK",timer=10000)
        })
        
        observeEvent(input$more,{
            shinyalert(title="Freedom on Twitter",text="This table contains the statistical data of the Twitter conversation about freedom, using the #freedom hashtag",
                       closeOnEsc=TRUE,closeOnClickOutside=TRUE,animation=TRUE,confirmButtonText="OK",timer=10000)
        })
        observeEvent(input$delete,{
            updateTextInput(session,"num",value="",placeholder="0")
            updateTextInput(session,"numb",value="",placeholder="0")
            updateTextInput(session,"number",value="",placeholder="0")
            updateTextInput(session,"numbers",value="",placeholder="0")
            updateTextInput(session,"numbered",value="",placeholder="0")
        })
        observeEvent(input$remove,{
            updateTextInput(session,"fig",value="",placeholder="0")
            updateTextInput(session,"figs",value="",placeholder="0")
            updateTextInput(session,"figu",value="",placeholder="0")
            updateTextInput(session,"figur",value="",placeholder="0")
            updateTextInput(session,"figure",value="",placeholder="0")
        })
        observeEvent(input$vanish,{
            updateTextInput(session,"deb",value="",placeholder="0")
            updateTextInput(session,"debt",value="",placeholder="0")
            updateTextInput(session,"debts",value="",placeholder="0")
            updateTextInput(session,"debtor",value="",placeholder="0")
            updateTextInput(session,"debtors",value="",placeholder="0")
        })
        
        
        doc<-reactive({c(if(nchar(input$text)>0){input$text},
                         if(nchar(input$texts)>0){input$texts},
                         if(nchar(input$word)>0){input$word},
                         if(nchar(input$words)>0){input$words},
                         if(nchar(input$wordy)>0){input$wordy}
        )
        })
        profit<-reactive({
            as.numeric(c(if(input$num>0){input$num},
                         if(input$numb>0){input$numb},
                         if(input$number>0){input$number},
                         if(input$numbers>0){input$numbers},
                         if(input$numbered>0){input$numbered}))
        })
        
        turnover<-reactive({
            as.numeric(c(if(input$fig>0){input$fig},
                         if(input$figs>0){input$figs},
                         if(input$figu>0){input$figu},
                         if(input$figur>0){input$figur},
                         if(input$figure>0){input$figure}))
            
        })
        
        receivables<-reactive({
            as.numeric(c(if(input$deb>0){input$deb},
                         if(input$debt>0){input$debt},
                         if(input$debts>0){input$debts},
                         if(input$debtor>0){input$debtor},
                         if(input$debtors>0){input$debtors}))
            
        })
        
        
        output$table.down<-downloadHandler(
            filename=function(){
                paste("Metrics",".csv",sep="")
            },
            content=function(file){
                write.csv(disease,file)
            }
        )
        
        output$flat<-downloadHandler(
            filename=function(){
                paste("Freedom",".csv",sep="")
            },
            content=function(file){
                write.csv(freedom,file)
            }
        )
        
        disease<-read.csv("metrics.csv",header=TRUE,sep=",")
        
        disease.df<-data.frame(disease)
        
        pie.data<-reactive({head(disease$Degree,n=8)})
        
        bar.data<-reactive({head(freedom$Outdegree,n=6)})
        
        freedom<-read.csv("Freedom.csv",header=TRUE,sep=",")
        
        freedom.df<-data.frame(freedom)
        
        data.X<-reactive({switch(input$select,
                                 "Indegree"=disease$Indegree,
                                 "Outdegree"=disease$Outdegree,
                                 "Degree"=disease$Degree,
                                 "Normalized"=disease$Normalized,
                                 "Domain"=disease$Domain,
                                 "Proximity"=disease$Proximity,
                                 "Modularity"=disease$Modularity,
                                 "Clusters"=disease$Clusters
        )})
        
        data.Y<-reactive({switch(input$choice,
                                 "Indegree"=disease$Indegree,
                                 "Outdegree"=disease$Outdegree,
                                 "Degree"=disease$Degree,
                                 "Normalized"=disease$Normalized,
                                 "Domain"=disease$Domain,
                                 "Proximity"=disease$Proximity,
                                 "Modularity"=disease$Modularity,
                                 "Clusters"=disease$Clusters
        )})
        
        
        output$metrics.table<-renderReactable({
            
            reactable(disease.df,
                      searchable=TRUE,
                      outlined=TRUE,
                      highlight=TRUE,
                      bordered=TRUE,
                      striped=TRUE,
                      compact=TRUE,
                      defaultColDef=colDef(
                          align="center",
                          headerStyle=list(background="#5dade2")
                      ))
        })
        
        output$freedom.table<-renderReactable({
            
            reactable(freedom.df,
                      compact=TRUE,
                      striped=TRUE,
                      searchable=TRUE,
                      bordered=TRUE,
                      highlight=TRUE,
                      defaultColDef=colDef(
                          align="center",
                          headerStyle=list(background="#5dade2")
                      ))
        })
        #This is the function for calculating profitability ratio
        profitability<-function(profit,turnover){
            profitability=round((profit/turnover)*100,1)
            return(profitability)
        }
        profitability.ratio<-reactive({profitability(profit(),turnover())})
        
        #This is the function for calculating efficiency ratio
        efficiency<-function(receivables,turnover){
            efficiency<-round((receivables/turnover)*365,1)
            return(efficiency)
        }
        
        efficiency.reactive<-reactive({
            efficiency(receivables(),turnover())
        })
        
        Analyze<-reactive({
            round(analyzeSentiment(
                replace_symbol(
                    replace_number(
                        replace_ordinal(
                            doc())))),1)})
        
        QDAP<-reactive({Analyze()$SentimentQDAP})
        LoughranM<-reactive({Analyze()$SentimentLM})
        HarvardIV<-reactive({Analyze()$SentimentGI})
        
        word.count<-reactive({countWords(doc(),removeStopwords=FALSE)})
        
        tables<-reactive({
            data.frame(QDAP(),LoughranM(),HarvardIV())
        })
        
        data<-reactive({switch(input$choice,
                               "QDAP"=tables()$QDAP,
                               "LoughranM"=tables()$LoughranM,
                               "HarvardIV"=tables()$HarvardIV)})
        
        
        output$download<-downloadHandler(
            filename=function(){
                paste("table",".csv",sep="")
            },
            content=function(file){
                write.csv(tables(),file)
            }
        )
        
        output$drop<-downloadHandler(
            filename=function(){
                paste("Barplot",".jpg",sep="")
            },
            content=function(file){
                jpeg(file)
                barplot(profitability.ratio(),
                        col=c("#5dade2","#ec7063","#48c9b0","#a569bd","#f4d03f"),
                        beside=TRUE,
                        border="white",
                        xlab="Years",
                        ylab="Margins in (%)")
                dev.off()
            }
        )
        
        output$fall<-downloadHandler(
            filename=function(){
                paste("Piechart",".jpg",sep="")
            },
            
            content=function(file){
                jpeg(file)
                pie(profitability.ratio(),radius=1.1,col=c("#5dade2","#ec7063","#48c9b0","#a569bd","#f4d03f"),
                    border="white",
                    clockwise=TRUE,
                    init.angle=90,
                    labels=profitability.ratio())
                dev.off()
            }
        )
        
        output$down<-downloadHandler(
            filename=function(){
                paste("Piechart",".jpg",sep="")
            },
            
            content=function(file){
                jpeg(file)
                pie(efficiency.reactive(),radius=1.1,border="white",clockwise=TRUE,
                    init.angle=90,
                    labels=efficiency.reactive(),
                    col=c("#5dade2","#85c1e9","#3498db","#2e86c1","#2874a6"))
                dev.off()
            }
        )
        
        output$plummet<-downloadHandler(
            filename=function(){
                paste("Barplot",".jpg",sep="")
            },
            content=function(file){
                jpeg(file)
                barplot(efficiency.reactive(),
                        col=c("#5dade2","#85c1e9","#3498db","#2e86c1","#2874a6"),
                        border="white",
                        beside=TRUE,
                        xlab="Years",
                        ylab="Days")
                dev.off()
            }
        )
        
        output$plot.down<-downloadHandler(
            filename=function(){
                paste("Graph",".jpg",sep="")
            },
            content=function(file){
                jpeg(file)
                color<-switch(input$color,
                              "Blue"="#5dade2",
                              "Red"="#e74c3c",
                              "Green"="#1abc9c",
                              "Yellow"="#f7dc6f",
                              "Purple"="#a569bd")
                barplot(data(),col=color,border="white",xlab="Texts",ylab="Sentiment Scores",main="Bar Plot of Sentiment Scores")
                dev.off()
            }
        )
        
        output$table<-renderReactable({
            input$run
            isolate(reactable(tables(),searchable=TRUE,bordered=TRUE,defaultColDef=colDef(
                align="center",
                headerStyle=list(background="#5dade2"),
                style=function(value){
                    if(value>0){color<-"#27ae60"}
                    else if(value<0){color<-"#e74c3c"}
                    else{color<-"#5dade2"}
                    list(color=color,fontWeight="bold")
                }),
                highlight=TRUE,outlined=TRUE,striped=TRUE,filterable=FALSE,compact=TRUE,onClick="expand")
            )
        })
        
        output$count<-renderReactable({
            input$run
            isolate(reactable(data.frame(word.count()),bordered=TRUE,striped=TRUE,compact=TRUE,
                              defaultColDef=colDef(
                                  align="center",
                                  headerStyle=list(background="#85c1e9"))
            ))
        })
        
        output$plot<-renderPlot({
            
            color<-switch(input$color,
                          "Blue"="#5dade2",
                          "Red"="#e74c3c",
                          "Green"="#1abc9c",
                          "Yellow"="#f7dc6f",
                          "Purple"="#a569bd")
            input$run 
            isolate(barplot(data(),col=color,border="white",xlab="Texts",ylab="Sentiment Scores",main="Bar Plot of Sentiment Scores"))
            
        })
        output$graph<-renderPlot({
            
            input$run
            isolate(plotSentiment(data(),xlab="Texts",ylab="Sentiment Scores"))
        })
        
        output$bar<-renderPlot({
            
            input$go
            isolate(barplot(profitability.ratio(),
                            col=c("#5dade2","#ec7063","#48c9b0","#a569bd","#f4d03f"),
                            beside=TRUE,
                            border="white",
                            xlab="Years",
                            ylab="Margins in (%)"))
            
            
        })
        
        output$pie<-renderPlot({
            
            input$go
            isolate(pie(profitability.ratio(),radius=1.1,col=c("#5dade2","#ec7063","#48c9b0","#a569bd","#f4d03f"),
                        border="white",
                        clockwise=TRUE,
                        init.angle=90,
                        labels=profitability.ratio()))
            
            
            
        })
        
        output$sphere<-renderPlot({
            
            input$away
            isolate(
                pie(efficiency.reactive(),radius=1.1,border="white",clockwise=TRUE,
                    init.angle=90,
                    labels=efficiency.reactive(),
                    col=c("#5dade2","#85c1e9","#3498db","#2e86c1","#2874a6"))
            )
        })
        
        output$bin<-renderPlot({
            input$away
            isolate(
                barplot(efficiency.reactive(),
                        col=c("#5dade2","#85c1e9","#3498db","#2e86c1","#2874a6"),
                        border="white",
                        beside=TRUE,
                        xlab="Years",
                        ylab="Days")
            )
        })
        
        output$draw<-renderPlot({
            
            hist(data.X(),border="white",col="#3498db",main="Variable Plots",xlab="Metrics")
        })
        
        output$art<-renderPlot({
            
            plot(data.X(),disease$Modularity,col="#e74c3c",xlab="Metrics",ylab="Value",pch=20,
                 cex=2,type="h",main="Variable Plots")
        })
        
        output$paint<-renderPlot({
            
            pie(pie.data(),radius=1.1,clockwise=TRUE,init.angle=input$slide,
                border="white",col=c("#5dade2","#ec7063","#48c9b0","#a569bd","#f4d03f"),main="Pie Chart of Degrees")
        })
        
        output$part<-renderPlot({
            
            barplot(bar.data(),border="white",main="Bar Plot of Outdegrees",
                    xlab="Outdegrees",ylab="Values",col=c("#5dade2","#ec7063","#48c9b0","#a569bd","#f4d03f"))
        })
        
    }
}

shinyApp(ui=ui,server=server)

Here is the log from the deployed app:

2020-05-14T15:52:54.056269+00:00 shinyapps[2244614]: Server version: 1.8.2-10
2020-05-14T15:52:54.056270+00:00 shinyapps[2244614]: LANG: en_GB.UTF-8
2020-05-14T15:52:54.056345+00:00 shinyapps[2244614]: R version: 3.6.0
2020-05-14T15:52:54.056346+00:00 shinyapps[2244614]: shiny version: 1.4.0.2
2020-05-14T15:52:54.056347+00:00 shinyapps[2244614]: httpuv version: 1.5.2
2020-05-14T15:52:54.056349+00:00 shinyapps[2244614]: RJSONIO version: (none)
2020-05-14T15:52:54.056348+00:00 shinyapps[2244614]: jsonlite version: 1.6.1
2020-05-14T15:52:54.056366+00:00 shinyapps[2244614]: htmltools version: 0.4.0
2020-05-14T15:52:54.056488+00:00 shinyapps[2244614]: Using pandoc: /opt/connect/ext/pandoc2
2020-05-14T15:52:54.056348+00:00 shinyapps[2244614]: rmarkdown version: (none)
2020-05-14T15:52:54.056348+00:00 shinyapps[2244614]: knitr version: (none)
2020-05-14T15:52:54.222678+00:00 shinyapps[2244614]: Using jsonlite for JSON processing
2020-05-14T15:52:54.233534+00:00 shinyapps[2244614]: 
2020-05-14T15:52:54.233535+00:00 shinyapps[2244614]: Starting R with process ID: '82'
2020-05-14T15:52:54.265375+00:00 shinyapps[2244614]: Error in value[[3L]](cond) : object 'server' not found
2020-05-14T15:52:54.265377+00:00 shinyapps[2244614]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2020-05-14T15:52:54.265378+00:00 shinyapps[2244614]: Execution halted
2020-05-14T16:00:01.903062+00:00 shinyapps[2244614]: Server version: 1.8.2-10
2020-05-14T16:00:01.903119+00:00 shinyapps[2244614]: LANG: en_GB.UTF-8
2020-05-14T16:00:01.903122+00:00 shinyapps[2244614]: shiny version: 1.4.0.2
2020-05-14T16:00:01.903121+00:00 shinyapps[2244614]: R version: 3.6.0
2020-05-14T16:00:01.903122+00:00 shinyapps[2244614]: httpuv version: 1.5.2
2020-05-14T16:00:01.903123+00:00 shinyapps[2244614]: rmarkdown version: (none)
2020-05-14T16:00:01.903123+00:00 shinyapps[2244614]: knitr version: (none)
2020-05-14T16:00:01.903123+00:00 shinyapps[2244614]: jsonlite version: 1.6.1
2020-05-14T16:00:01.903124+00:00 shinyapps[2244614]: RJSONIO version: (none)
2020-05-14T16:00:01.903124+00:00 shinyapps[2244614]: htmltools version: 0.4.0
2020-05-14T16:00:01.903278+00:00 shinyapps[2244614]: Using pandoc: /opt/connect/ext/pandoc2
2020-05-14T16:00:02.069633+00:00 shinyapps[2244614]: Using jsonlite for JSON processing
2020-05-14T16:00:02.079726+00:00 shinyapps[2244614]: 
2020-05-14T16:00:02.079727+00:00 shinyapps[2244614]: Starting R with process ID: '23'
2020-05-14T16:00:02.112496+00:00 shinyapps[2244614]: Error in value[[3L]](cond) : object 'server' not found
2020-05-14T16:00:02.112499+00:00 shinyapps[2244614]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2020-05-14T16:00:02.112500+00:00 shinyapps[2244614]: Execution halted
2020-05-14T16:00:22.583323+00:00 shinyapps[2244614]: Server version: 1.8.2-10
2020-05-14T16:00:22.583326+00:00 shinyapps[2244614]: LANG: en_GB.UTF-8
2020-05-14T16:00:22.583356+00:00 shinyapps[2244614]: R version: 3.6.0
2020-05-14T16:00:22.583357+00:00 shinyapps[2244614]: shiny version: 1.4.0.2
2020-05-14T16:00:22.583357+00:00 shinyapps[2244614]: httpuv version: 1.5.2
2020-05-14T16:00:22.583358+00:00 shinyapps[2244614]: rmarkdown version: (none)
2020-05-14T16:00:22.583358+00:00 shinyapps[2244614]: knitr version: (none)
2020-05-14T16:00:22.583358+00:00 shinyapps[2244614]: jsonlite version: 1.6.1
2020-05-14T16:00:22.583379+00:00 shinyapps[2244614]: htmltools version: 0.4.0
2020-05-14T16:00:22.583379+00:00 shinyapps[2244614]: RJSONIO version: (none)
2020-05-14T16:00:22.583566+00:00 shinyapps[2244614]: Using pandoc: /opt/connect/ext/pandoc2
2020-05-14T16:00:22.741154+00:00 shinyapps[2244614]: Using jsonlite for JSON processing
2020-05-14T16:00:22.750753+00:00 shinyapps[2244614]: 
2020-05-14T16:00:22.750754+00:00 shinyapps[2244614]: Starting R with process ID: '39'
2020-05-14T16:00:22.779959+00:00 shinyapps[2244614]: Error in value[[3L]](cond) : object 'server' not found
2020-05-14T16:00:22.779960+00:00 shinyapps[2244614]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2020-05-14T16:00:22.779973+00:00 shinyapps[2244614]: Execution halted

Try not enclosing your code in this if statement, on the server the code doesn't get executed interactively so all your code is ignored.

3 Likes

I will try that and revert to you Andresrcs. Thanks a lot for patiently helping me find a solution.

Hi Andresrcs, thanks so much, my app now deploys and runs just fine. It was a really bumpy ride, but it's settled now. I am really grateful for your patience and advice. Thanks again

You're welcome, If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.