'Flexdashboard using actionButton to reset input
I am trying to make a flexdashboard in r. The whole thing should later become a user interface for a portfolio optimization. For this I need some inputs of course. I have now a sliderInput and two ActionButtons. One should display the input value in a valueBox when the button is clicked. This works. The other button should set the inputSlider to 0. This does not work. Anybody got an idea?
Thanks already. Greetings from Switzerland
This is my code:
---
title: "example"
runtime: shiny
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
```
Testing
================================
Column {.sidebar}
-----------------------------------------------------------------------
Your Input here:
```{r}
sliderInput("risk", label = "Risk",
min = 0, max = 10, value = 0, step = 0.1)
actionButton("go", "Go")
actionButton("clear", "Clear")
```
Column
-----------------------------------------------------------------------
### Chart A
```{r}
renderValueBox({
req(input$go)
valueBox(value = isolate(input$risk))
})
```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
