i am trying to make a graph about child mortality, it works fine when i select just one country but it seems to exclude data points when i select multiple countries, i have included 2 images to show the problem. mdg1a is the data set containing the info for all years, all regions, all countriesthis is how it looks for 1 country Here you see the NA when selecting 2 countries
cir <- reactive({
#cir stands for Countries In Region
if (is.null(input$regionInput)) {
return(NULL)
}
if (input$regionInput == "All") {
mdg1a
} else {
mdg1a %>%
filter(region == input$regionInput)
}
})
output$countryOutput <- renderUI({
selectInput("countryInput", "country",
sort(unique(cir()$country)),
multiple = TRUE,
selected = "")
})
filtered <- reactive({
if (is.null(input$regionInput)) {
return(NULL)
}
if (is.null(input$countryInput)) {
return(NULL)
}
cir() %>%
filter(year >= input$yearInput[1],
year <= input$yearInput[2],
country == input$countryInput)
})