Dear Community,
I would like to change the color of one valuebox according by comparing the mean of a variable (here OverallYield) to a specific threshold (here = 80)
### Average Value (for selected options)
```{r}
renderValueBox({
valueBox(round(mean(selectedData()$OverallYield)),
if(round(mean(selectedData()$OverallYield)) >80){
color = "green"
} else {
color = "red"
})
})
With the code above, the word "green" or "red" appears depending on the threshold (80).
Any idea how i can link this to the valuebox color instead of words "green / red" ?
Note that: selectedData() is reactive.
Thanks