Scrolling using R shiny

I have a dataset of a survey where there are 100 enumerators. I want to make a dashboard in shiny. The plot must show enumerator-wise number of surveys. In the sample below, I have used an example dataset with only 3 enumerators. When I display 100 enumerators, and I select all 100, rather than a long page that shows all the enumerators, can there be scroll down feature which can be used?

library(tidyverse)
library(shiny)
library(shinydashboard)
#> 
#> Attaching package: 'shinydashboard'
#> The following object is masked from 'package:graphics':
#> 
#>     box
library(shinyjs)
#> Warning: package 'shinyjs' was built under R version 4.1.2
#> 
#> Attaching package: 'shinyjs'
#> The following object is masked from 'package:shiny':
#> 
#>     runExample
#> The following objects are masked from 'package:methods':
#> 
#>     removeClass, show
data<-tibble::tribble(
  ~enumerator, ~marks,
        "sai",    15L,
       "binu",    10L,
        "sai",    20L,
        "sai",    15L,
        "sai",    15L,
        "sai",    11L,
        "sai",    12L,
        "sai",    13L,
        "sai",    17L,
       "binu",    11L,
       "binu",    16L,
       "binu",    12L,
       "binu",    17L,
       "binu",    11L,
       "binu",    20L,
       "binu",    13L
  )

ui<-dashboardPage(
  skin="red",
  dashboardHeader(title="Enumerator-wise number"),
  dashboardSidebar(
    selectInput("enum","Select the enumerator name",choices =unique(data$enumerator),multiple=T,selected="sai")),
  dashboardBody(
    tabsetPanel(type="tabs",
                id="tab_selected",
      tabPanel(title="Enumerator tab",
               plotOutput("plot1"))
    )
  )
)

server<-function(input,output){
  output$plot1<-renderPlot({
    ggplot(aes(input$enum))+
      geom_bar(width=0.5)
  })
}

shinyApp(ui,server)
#> PhantomJS not found. You can install it with webshot::install_phantomjs(). If it is installed, please make sure the phantomjs executable can be found via the PATH variable.
Shiny applications not supported in static R Markdown documents
Created on 2022-03-26 by the reprex package (v2.0.1)

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.