Just trying to recreate the "Only Relevant Values" feature that some of you may know from Tableau filters... but trying to do this in an RShiny flexdashboard.
Basically, I have a table of chocolates and their companies... When I select a company I only want to see the options for the chocolates of that company. (I already know how to do this one way filtering)...
More importantly I also want the company options to react if I was to select a specific chocolate before a company... for their options to reduce accordingly.
Here is my code:
---
title: "reactive test"
output:
flexdashboard::flex_dashboard
runtime: shiny
---
```{r}
library(tidyverse)
```
```{r}
candyData <- read.table(
text = "Brand Candy
Nestle 100Grand
Nestle Butterfinger
Nestle Crunch
Hershey's KitKat
Hershey's Reeses
Hershey's Mounds
Mars Snickers
Mars Twix
Mars M&Ms",
header = TRUE,
stringsAsFactors = FALSE)
```
Sidebar {.sidebar}
---
```{r}
radioButtons("brand",
"brand:",
choices = c("All", unique(candyData$Brand)),
selected = "All")
radioButtons("candy_name",
"candy_name:",
choices = c("All", unique(candyData$Candy)),
selected = "All")
```
Very appreciative of any help with this... or even advice on whether it's even possible.