Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Shiny

You're reading from   Learning Shiny Make the most of R's dynamic capabilities and implement web applications with Shiny

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781785280900
Length 246 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Hernan Resnizky Hernan Resnizky
Author Profile Icon Hernan Resnizky
Hernan Resnizky
Hernan Resnizky Hernan Resnizky
Author Profile Icon Hernan Resnizky
Hernan Resnizky
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Introducing R, RStudio, and Shiny FREE CHAPTER 2. First Steps towards Programming in R 3. An Introduction to Data Processing in R 4. Shiny Structure – Reactivity Concepts 5. Shiny in Depth – A Deep Dive into Shiny's World 6. Using R's Visualization Alternatives in Shiny 7. Advanced Functions in Shiny 8. Shiny and HTML/JavaScript 9. Interactive Graphics in Shiny 10. Sharing Applications 11. From White Paper to a Full Application Index

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 is done every time an input changes. The underlying problem is that the load of the iris dataset does not actually depend on the input passed. In other words, it is independent from the application's reactive process.

Shiny provides, basically,...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime