Book Image

Learning Shiny

By : Hernan Resnizky
Book Image

Learning Shiny

By: Hernan Resnizky

Overview of this book

Table of Contents (19 chapters)
Learning Shiny
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introducing R, RStudio, and Shiny
Index

Input updates


These functions are particularly useful when the options of an input are determined in some way by another input. For example, if a continent was one input and a country the other, the options of the latter would be restricted by the selection of the first.

In order to use input updates, the Shiny server needs to be initialized with an additional session argument. This means that the following should not be the starting line:

shinyServer(function(input, output){

Instead of the preceding code, this must be the starting line:

shinyServer(function(input, output,session){

Session is an optional parameter that can be included in the Shiny server function calls. This creates an object of the session class that keeps track of certain session information. For input updates, the session object is needed as it contains a function to communicate with the inputs (sendInputMessage) and consequently update it. However, there is no need to have a deep knowledge about session objects, as the high...