title: Shiny App Not Running in Shinyapps.io (Error: Object UI Not Found)
body: <p>I have successfully run the following Shiny App locally.  Unfortunately, when I run it in shinyapps.io, I get the following error message from my log: Error in force(ui) : object 'ui' not found.  Even after extensive tracing, I could not find anything else that points to why ui could not be found, and again it can run locally.</p>
  
  <p>Here is the complete log:</p>
  
  <pre><code>
  tidyverse_conflicts() ── ✖ dplyr::filter() masks stats::filter() ✖ dplyr::lag() masks stats::lag() 
  
  Warning: replacing previous import ‘mgcv::multinom’ by ‘nnet::multinom’ when loading ‘cfbscrapR’ 
  
  The following objects are masked from ‘package:shiny’: dataTableOutput, renderDataTable 
  
  The following object is masked from ‘package:shiny’: serverInfo Attaching package: ‘rsconnect’ 
  
  64: shinyApp Warning: Error in force: object 'ui' not found –
  
  </code></pre>
  
  <p>Here is my code for ui.R:</p>
  
  <pre><code>library(tidyverse)
  library(cfbscrapR)
  library(gt)
  library(dplyr)
  library(ggplot2)
  library(DT)
  library(shiny)
  library(shinythemes)
  library(rsconnect)
  library(logger)
  
  ###Now create the ui function
  
  ui &lt;- fluidPage(
    titlePanel(h1("College Football Analytics")),
    sidebarPanel(
      checkboxGroupInput("selections", label = h2(
        "Choose Weeks to Analyze"),
        choices = list("Week 1" = 1, "Week 2" = 2,
                       "Week 3" = 3, "Week 4" = 4,
                       "Week 5" = 5, "Week 6" = 6,
                       "Week 7" = 7, "Week 8" = 8,
                       "Week 9" = 9, "Week 10" = 10,
                       "Week 11" = 11, "Week 12" = 12,
                       "Week 13" = 13, "Week 14" = 14,
                       "Week 15" = 15),
        selected = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11",
                     "12", "13", "14", "15")),
      actionButton("submit", "Update")
    ),
    mainPanel(
      h2("2019 Season"),
      DT::dataTableOutput("table"),
      theme = shinytheme("cerulean")
    )
  )
  </code></pre>
  
  <p>And as for server.R:</p>
  
  <pre><code>library(tidyverse)
  library(cfbscrapR)
  library(gt)
  library(dplyr)
  library(ggplot2)
  library(DT)
  library(shiny)
  library(shinythemes)
  library(rsconnect)
  library(logger)
  
  pbp_2019 &lt;- read.csv("pbp_2019.csv")
  drives_2019 &lt;- read.csv("drives_2019.csv")
  
  
  #Define server logic
  server &lt;- function(input, output, session) {
    cfb.table2 &lt;- reactive({
      input$submit
      isolate({
        req(input$selections)
        new.pbp_2019 &lt;- subset(pbp_2019, week %in% input$selections)})
    })
    plays &lt;- reactive({cfb.table2() %&gt;% filter(rush == 1 | pass == 1)})
    offense &lt;- reactive({plays() %&gt;% group_by(offense_play) %&gt;% summarise(ypa = mean(yards_gained[pass==1]), ypr = mean(yards_gained[rush==1]), num.plays = n()) %&gt;% filter(num.plays &gt; 300)})
    offense &lt;- reactive({plays() %&gt;% group_by(offense_play) %&gt;% summarise(epa.pass.off = mean(EPA[pass==1]), success.rate = mean(success), epa.rush.off = mean(EPA[rush==1]), num.plays = n()) %&gt;% filter(num.plays &gt; 300)})
    defense &lt;- reactive({plays() %&gt;% group_by(defense_play) %&gt;% summarise(epa.pass.def = mean(EPA[pass==1]), epa.rush.def = mean(EPA[rush==1]), num.plays = n()) %&gt;% filter(num.plays &gt; 300)})
    update.epa &lt;- reactive({left_join(offense(), defense(), by = c("offense_play" = "defense_play"))})
    drives.table2 &lt;- reactive({
      input$submit
      isolate({
        req(input$selections)
        new.drives_2019 &lt;- subset(drives_2019, week %in% input$selections)})
    })
    games &lt;- cfb_game_info(2019) %&gt;% rename("game_id" = id)
    drives.off &lt;- reactive({drives.table2() %&gt;% left_join(games, by = c("game_id")) %&gt;%
        mutate(
          adj_start_yardline = ifelse(offense == away_team, 100-start_yardline, start_yardline), 
          success = ifelse(drive_result %in% c("TD", "FG"), 1, 0),
          drive.pts = ifelse(drive_result == "TD", 6, ifelse(drive_result == "FG", 3, 0))) %&gt;%
        group_by(offense) %&gt;% 
        summarise(
          fp = mean(adj_start_yardline[adj_start_yardline &gt; 10 &amp; adj_start_yardline &lt;40]), 
          srate = mean(success),
          drives = n(),
          drives.pts = sum(drive.pts))
    })
    drive.update.epa &lt;- reactive({left_join(update.epa(), drives.off(), by=c("offense_play"="offense")) %&gt;%
        mutate(pts.per.drive = drives.pts / drives)})
    cfb.table3 &lt;- reactive({data.frame(drive.update.epa() %&gt;% 
                                         select(offense_play, success.rate, epa.pass.off, epa.rush.off, epa.pass.def, epa.rush.def, fp, drives, pts.per.drive) %&gt;% gt() %&gt;%
                                         tab_header(title = "2019 Season"))})
    output$table = DT::renderDataTable({
      datatable(cfb.table3(),
                rownames = FALSE, 
                class = 'cell-border stripe',
                colnames = c('Team', 'Success Rate',
                             'Pass EPA', 'Run EPA',
                             'Pass EPA Def.',
                             'Run EPA Def.',
                             'Avg. Field Position',
                             'Drives',
                             'Points Per Drive'),
                list(pageLength = 25)) %&gt;%
        formatPercentage(c('success.rate'),1) %&gt;%
        formatRound(c('epa.pass.off'),3) %&gt;%
        formatRound(c('epa.rush.off'),3) %&gt;%
        formatRound(c('epa.pass.def'),3) %&gt;%
        formatRound(c('epa.rush.def'),3) %&gt;%
        formatRound(c('fp'),1) %&gt;%
        formatRound(c('pts.per.drive'),3)
    })
  }
  
  #Run the application
  shinyApp(ui = ui, server = server)
  </code></pre>