O'Reilly logo

Learning Shiny by Hernán G. Resnizky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reactive independent processes within an application

Let's imagine an application that loads the iris dataset and returns the mean and median of numeric variables based upon the species selected. With the elements seen so far, the output generation process would consist of the following:

  • Load the iris dataset
  • Subset the dataset with the species selected
  • Calculate the mean for each variable
  • Calculate the median for each variable
  • Output the mean and median

As it has been explained before, every reactive element (like outputs) are re-executed whenever an input changes. So, in this case, these five processes would be in constant re-execution.

However, there is an evident issue in this situation: the dataset is always the same one, so the exact same operation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required