Is there any way to update the contents of a selectInput control inside an rmarkdown document?
For example, in the document below I would like the selectInput for B to have different choices depending on the value chosen for A.
It almost looks like one could use updateSelectizeInput(), but that takes a 'session' argument which I don't see exposed in rmarkdown.
Any ideas?
---
title: "An Empty Document"
output: html_document
runtime: shiny
---
This space intentionally left blank.
```{r eval=TRUE, echo=FALSE}
inputPanel(
selectInput("A", "Control A:", choices = c("A", "B", "C")),
selectInput("B", "Control B:", choices = c("1", "2", "3")),
selectInput("C", "Control C:", choices = NULL)
)
```
```{r eval=TRUE, echo=FALSE}
reactive({
if (input$A == "B") {
# I would like to update the choices for selectInput B here.
}
})
```