shinyapp reactive link not working

Hi, I am trying to create a shiny app for an assignment and it runs well.

This is UI coding

library(shiny)
library(shinydashboard)
library(rsconnect)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
  
  # Application title
  titlePanel(title="World Leaders",windowTitle = "Assignment 5"),
  
  # Sidebar with a slider input for number of bins 
  sidebarLayout(
    sidebarPanel(
      selectInput("acc", "Choose an hashtag:", choices = c(" #KimJongUn", "#realDonaldTrump", "#XiJinPing", "#AngelaMerkel", "#TheresaMay", "#VladimirPutin", "#EmmanuelMacron"))
    ),
    
    # Show a plot of the generated distribution
    mainPanel(
      dashboardBody(
        fluidRow(
      
          valueBoxOutput("posts"),
          
          valueBoxOutput("retweet"),
          
          valueBoxOutput("ratio")
        ),
        fluidRow(
                box(title="Top Posters", solidHeader = TRUE, status = "primary",
              tableOutput("topposters"),
              box(title="Major Sources", solidHeader = TRUE, status = "primary",
              tableOutput("topsources"),
              box(title="Top Locations", solidHeader = TRUE, status = "primary",
              tableOutput("toplocations"),
              box(title="Top Mentions", solidHeader = TRUE, status = "primary",
              tableOutput("topmentions"),
              box(title="Major Domains", solidHeader = TRUE, status = "primary",
              tableOutput("topdomains"),
              box(title="Text Analysis", solidHeader = TRUE, status = "primary",
              tableOutput("toptexts")))
                  ))))
        )
      )
    )
  )
))
library(knitr)
library(shiny)
library(shinydashboard)
library(rsconnect)
library(rtweet)

shinyServer(function(input, output) {
 
   
   
  Hashtag <- readRDS("#KimJongUn.rds")
 ip_handle <- reactive({
    switch(input$acc,"#KimJongUn" = readRDS("#KimJongUn.rds"),"#realDonaldTrump" = readRDS("#DonaldTrump.rds"), "#XiJinPing" = readRDS("#XiJinPing.rds"),"#AngelaMerkel" = readRDS("#AngelaMerkel.rds"), "#TheresaMay" = readRDS("#TheresaMay.rds"), "#VladimirPutin" = readRDS("#VladimirPutin.rds"), "#EmmanuelMacron" = readRDS("#EmmanuelMacron.rds") )
  })
  
   output$handle_name <- renderText({
    ip_handle$screen_name
  })
  
  
  output$profile_pic <- renderUI({
    imgurl <- ip_handle$profile_image_url
    tags$img(src=imgurl, width = 100, height = 100)
  })
  
  output$posts <- renderValueBox({
    valueBox(
      sum(Hashtag$statuses_count), "Post Count", icon = icon("list"),
      color = "yellow"
    )
  })
  
  output$retweet <- renderValueBox({
    valueBox(
      sum(Hashtag$retweet_count), "Retweet Count", icon = icon("list"),
      color = "purple"
    )
  })
  
  output$ratio <- renderValueBox({
    valueBox(
      sum(Hashtag$statuses_count)/sum(Hashtag$retweet_count), "Original/Retweet proportion", icon = icon("list"),
      color = "purple"
    )
  })
  
  output$topposters <- renderTable({
    sort(table(unlist(Hashtag$screen_name)),decreasing=T)[1:5]
  })  
  
    output$topsources <- renderTable({
    sort(table(unlist(Hashtag$source)),decreasing=T)[1:5]
  })  
    
    output$toplocations <- renderTable({
      sort(table(unlist(Hashtag$location)),decreasing=T)[1:5]
    })  
   
    output$topmentions <- renderTable({
      sort(table(unlist(Hashtag$mentions_screen_name)),decreasing=T)[1:5]
    })  
    
    output$topdomains <- renderTable({
      sort(table(unlist(Hashtag$url)),decreasing=T)[1:5]
    })  
    
    output$toptexts <- renderTable({
      sort(table(unlist(Hashtag$text)),decreasing=T)[1:5]
    })  
    
})

But my reactive link does not work. Can someone check if there is something wrong with my coding?

Thank you,
Best,
Rain

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