I want to apply multiple drop-down bottoms in Shiny as filters for the data. I found the following example. In this example one load a fixed data, namely mpg
fr
I think the problem lies in the server. Try this
function(input, output) {
#read the data
dataset <- reactive({
infile <- input$date
if (is.null(infile)){
return(NULL)
}
data<-read.table(paste0('---/data/',infile),header=TRUE, sep=";")
data[is.na(data)]<- 0
if (input$konz != "All") {
data <- data[data$Konzernbezeichnung == input$konz,]
}
if (input$group != "All") {
data <- data[data$Bestandseingruppierung == input$group,]
}
if (input$lgdK != "All") {
data <- data[data$LGD.Klasse == input$lgdK,]
}
})
# Filter data based on selections
output$plot <- renderPlot({
x <- dataset()$Marktwert
hist(x, breaks = 40)
})
}