'Reset inputs' button in shiny app

前端 未结 4 1701
既然无缘
既然无缘 2020-11-29 00:38

I would like to implement a \'Reset inputs\' button in my shiny app.

Here is an example with just two inputs where I\'m using the update functions to set the values

4条回答
  •  误落风尘
    2020-11-29 00:59

    You can also create a reset button by assigning NULL to your reactive values object.

    See this RStudio Shiny article on Using Action Buttons: http://shiny.rstudio.com/articles/action-buttons.html. Specifically, read the sections titled Pattern 4 - Reset buttons and Pattern 5 - Reset on tab change. Examples (including code) are provided in the article.

    The article provides solutions that don't require additional packages if that's a concern.

提交回复
热议问题