title: Dashboard in Shiny works locally but not on shinyapp.io
body: <p>I have built this dashboard that works when displayed locally but will not open when I try to deploy it to shinyapps.io. Based on my troubleshooting, I have specified the wd and made sure all the files are in the directory but haven't had any success. When I attempt to launch the dashboard in shinyapp.io I get the following message: <code>Error: an error has occured. Check your logs or contact the app author for clarification</code> The memory usage does not exceed 120 MB so I don't think that is the root of the problem. Any help would be greatly appreciated. I also would like to know if it is possible to have a selection box with names based on the value selected for location, similar to how it is fairly common to have a dropdown box of states after you've selected your country. </p>
  
  <pre><code>library(shiny)
  library(shinydashboard)
  library(ggplot2)
  library(rsconnect)
  library(lubridate)
  library(scales)
  library(plyr)
  library(dplyr)
  library(RColorBrewer)
  ```
  ```{r}
  AdjustedData&lt;- read.csv("Adjusted Data.csv")
  Target &lt;- data.frame(yintercept= 40.00, Target= factor(40.00))
  AdjustedData$Percentage &lt;- round(AdjustedData$Total.Procedure/AdjustedData$Reconciled.Visits*100, 2)
  AdjustedData$Percentage[is.na(AdjustedData$Percentage)] &lt;- 0
  opt &lt;- read.csv("optimization.csv")
  opt$OptPer &lt;- opt$Optimization*100
  opt$Location &lt;- as.character(opt$Location)
  opt$Location &lt;- ifelse(opt$Location == "New Jersey" | opt$Location == "Indiana" | opt$Location == "Pennsylvania", "New Jersey/Indiana/Pennsylvania", opt$Location)
  opt$Location &lt;- as.factor(opt$Location)
  
  
  
  ui &lt;- dashboardPage(
    dashboardHeader(title = "Performance Metrics"), 
    dashboardSidebar(), 
    dashboardBody(
      fluidRow(
              box(title = "Options",
              selectInput(inputId = "Month",
                              label = "Month:", 
                              choices = c("January" = "1", "February" = "2", "March" = "3")),
              selectInput(inputId = "Location",
                          label = "Location:", 
                          choices = c("Illinois", "Wound MD", "Ohio", "New York")), width = 1000, height = 200),
  
        box(plotOutput("barplot", height = 500, width= 800)),
        box(plotOutput("barplot2", height= 500, width = 800)),
        box(plotOutput("barplot3", height = 500, width = 800))
      )))
  
  server &lt;- function(input, output) {
  
  data &lt;- reactive({
    dataset &lt;- subset(AdjustedData, Location == input$Location &amp; Reconciled.Month == input$Month)
  })
  data2 &lt;- reactive({
    dataset2 &lt;- subset(opt, Location == input$Location &amp; Month == input$Month)
  })
  data3&lt;- reactive({
    dataset3 &lt;- subset(data, )
  })
   output$barplot &lt;-renderPlot({
      ggplot(data= data(), aes_string(x="Provider",y= "Per.Visit.Bill.Rate", fill = "Per.Visit.Bill.Rate")) +
     geom_bar(stat="identity")+
      labs(caption = "Data sourced from Provider Compensation Analysis and Monthly Summary \nof Billed Physician Encounters Reports. Rates have been adjusted to exclude \nthe deduction per visit for malpractice insurance where applicable.")+
     theme_light()+
     theme(plot.caption = element_text(size= 8, hjust = .5))+
      theme(axis.text.x=element_text(angle= 45, vjust=.5)) +
      ggtitle("Per Visit Bill Rate", input$Location)+
     theme(plot.title = element_text(size = 22, hjust = .5, family = "serif"))+
      theme(plot.subtitle = element_text(size = 18, hjust = .5, family = "serif"))+
     geom_text(aes(label=sprintf("$%.2f",Per.Visit.Bill.Rate)), position=position_dodge(width=0.9),hjust= .5, vjust=0,angle= 0) +
     scale_y_continuous(name = "Per Visit Bill Rate ($)", limits = c(0,100),breaks =seq(0,100,10), labels = dollar)+
     scale_color_continuous()+
     geom_hline(aes(yintercept = yintercept , linetype = Target), data = Target, color = "red", size = 1.0)+
     guides(fill=guide_legend(title = "Per Visit Bill Rate ($)", reverse = TRUE))+
        theme(plot.title = element_text(hjust = 0.5))
    })
   output$barplot2 &lt;-renderPlot({
      ggplot(data= data(), aes_string(x="Provider",y= "Percentage", fill= "Per.Visit.Bill.Rate")) + 
       geom_bar(stat = "identity")+
       geom_text(aes(x=Provider, y= Percentage, label=sprintf("%.1f%%", Percentage)), position=position_dodge(width=0.9),hjust= .5, vjust= 0 ,angle= 0)+
       labs(caption = "Data sourced from Provider Compensation Analysis and \nMonthly Summary of Billed Physician Encounters Reports, March 2018 \nRates have been calculated using the sum of all procedure codes.")+
     scale_y_continuous(name = "Percentage (%)", limits = c(0,100),breaks =seq(0,100,10))+
     scale_color_continuous()+ 
       theme(plot.caption = element_text(size= 8, hjust = .5))+
       theme(axis.text.x=element_text(angle= 0, vjust=.5))+ 
       ggtitle("Procedure Percentages", input$Location)+
       theme(plot.title = element_text(size = 22, hjust = .5, family = "serif"))+
       theme(plot.subtitle = element_text(size = 18, hjust = .5, family = "serif"))+
       guides(fill=guide_legend(title = "Month", reverse =FALSE))
         })
    output$barplot3 &lt;- renderPlot({
      ggplot(data= data2(), aes_string(x = "Provider", y= "OptPer", fill= "OptPer"))+
        geom_bar(stat = "identity") + 
        geom_text(aes(x= Provider, y= OptPer, label=sprintf("%.1f%%", OptPer)), position = position_dodge(width=.6), hjust= .5, vjust=0)+
        theme_light()+
        theme(axis.text.x=element_text(angle= 45, vjust=.5))+
        scale_color_continuous()+
        ggtitle("Optimization Percentages", input$Location)+ 
        labs(caption = "Data sourced from Provider Compensation Analysis Reports, March 2018")+ 
        theme(plot.caption = element_text(size= 8, hjust = .5))+ 
        ylab("Optimization Percentage")+
        theme(plot.title = element_text(size = 22, hjust = .5, family = "serif"))+
        theme(plot.subtitle = element_text(size = 18, hjust = .5, family = "serif"))+ 
        scale_y_continuous(limits= c(0,100), labels = function(x) paste0(x, "%")) + 
        guides(fill=guide_legend(title = "Optimization Percentage (%)", reverse = TRUE))
    })
  }
  shinyApp(ui, server)
  
  deployApp("DashboardApp.Rmd")
  </code></pre>
  
  <p>dataset: sample</p>
  
  <pre><code>Provider    Reconciled Month    Per Visit Bill Rate- w/Mal  Per Visit Bill Rate Location
  Andrews 1   27.68   30.57   Illinois
  Davids  2   25.08   29.08   New York
  Stein   3   31.39   31.39   New York
  Goodman 2   26.00   30.00   Wyoming
  Roberts 3   24.34   25.74   Utah
  Buckley 1   29.54   33.54   Ohio
  Castro  3   0.00    0.00    Ohio
  </code></pre>