Message-ID: <CAGY2U90zfJV_ff+C+QADKPmCMOmw5S2fe1rYRdzj3=jXjqh4+Q@mail.gmail.com>
Date: 2021-01-01T11:59:20Z
From: Ritwik Mohapatra
Subject: Multiple values not getting displayed in output based on multiple input selection from dropdown in R shiny
Hi All,
Happy New Year to All.
I have been trying to create a multi input select list/dropdown using r
shiny but when i select more than two values from the input,it doesn't show
the output for all the values selected in the dropdown.
The code is as follows:
knitr::opts_chunk$set(echo = TRUE)
library(shiny)
ui <- fluidPage(
selectInput("Region","Select
Region",max_usage_hours_per_region$Region,multiple=TRUE),
tableOutput("table")
)
server <- function(input, output) {
output$table <- renderTable(
max_usage_hours_per_region[max_usage_hours_per_region$Region==input$Region,])}
shinyApp(ui = ui, server = server)
max_usage_hours_per_region is a dataframe with the following output:-
Region Sum_as_Hours
1 Africa 1156.0833
2 Americas 740.1667
3 APAC 740.2833
4 Europe 1895.2000
5 PDO 1053.3500
6 UK 0.0000
Can anyone help with the same.
Thanks.
Regards,
Ritwik
[[alternative HTML version deleted]]