Can I make input fields dynamically change in Shiny based on other inputs?

为君一笑 提交于 2019-12-24 08:12:52

问题


I have a Shiny app in R with several inputs (drop-downs and sliders). Initially they all have default values for when the app opens, using the "selected" parameter.

But, i'm wondering if there is way to dynamically change the default value based on a certain input field.

Example, if I have one input field that is a drop-down of countries and then I have one slider input of price for a pint of beer. As a default "Ireland" is selected from the countries list and the slider is defaulted to €5.00. Now what I want is if I select "Poland" from the countries list the slider would then change to €2.00.

Is this possible and how?

Thanks,

Mike

来源:https://stackoverflow.com/questions/39567951/can-i-make-input-fields-dynamically-change-in-shiny-based-on-other-inputs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!