I am trying to make a checkbox to be able to filter the dataset by years. However not every variable has all the data for every year so I wanted only the years where the variable has data for shown in the ui. Sadly, after splitting my code into conditional panels the buttons do not filter any longer.
conditionalPanel(condition = "input.Select2 == 'AFD' | input.Select2 == 'Piraten'",
checkboxGroupInput("Year", label = h3("Checkbox group"),
choices = "2013"),
selected = "2013"),
conditionalPanel(condition = "input.Select2 == 'DieLinke'",
checkboxGroupInput("Year", label = h3("Checkbox group"),
choices = list("2009", "2013"),
selected = "2013")),
conditionalPanel(condition = "input.Select2 == 'Gruene' | input.Select2 == 'FDP' | input.Select2 == 'SPD' | input.Select2 == 'CDU'",
checkboxGroupInput("Year", label = h3("Checkbox group"),
choices = list("1998", "2002", "2005","2009", "2013"),
selected = "2013"))
Does anyone know why?
Here's an example of plot being generated in the server function:
dfParteien %>%
filter(Partei %in% chosen_party) %>%
filter(Jahr %in% input$Year) %>%
count(word) %>%
with(wordcloud(word, n, max.words = input$Slider1, colors=pal12))