1. 学习
  2. /
  3. 课程
  4. /
  5. Building Web Applications with Shiny in R

Connected

练习

Delay reactions with eventReactive()

Shiny's reactive programming framework is designed such that any changes to inputs automatically updates the outputs that depend on it. In some situations, we might want to explicitly control the trigger that causes the update.

The function eventReactive() is used to compute a reactive value that only updates in response to a specific event.

rval_x <- eventReactive(input$event, {
 # calculations
})

说明

100 XP
  • Use eventReactive() to delay the execution of computing BMI until the user clicks on the button.