Book Image

Web Application Development with R Using Shiny Second Edition - Second Edition

By : Chris Beeley
Book Image

Web Application Development with R Using Shiny Second Edition - Second Edition

By: Chris Beeley

Overview of this book

R is a highly flexible and powerful tool for analyzing and visualizing data. Most of the applications built using various libraries with R are desktop-based. But what if you want to go on the web? Here comes Shiny to your rescue! Shiny allows you to create interactive web applications using the excellent analytical and graphical capabilities of R. This book will guide you through basic data management and analysis with R through your first Shiny application, and then show you how to integrate Shiny applications with your own web pages. Finally, you will learn how to finely control the inputs and outputs of your application, along with using other packages to build state-of-the-art applications, including dashboards.
Table of Contents (14 chapters)
Web Application Development with R Using Shiny Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Advanced reactivity and data handling


Now that we've warmed up a bit, let's discuss loading data and reactivity in a bit more detail. The first thing to note is the different ways to load data in R and the effects each has. Data can be loaded before the shinyServer() function, within the shinyServer() function, or within a reactive function, which is itself defined within shinyServer().

Each has a different effect. Data loaded outside the shinyServer() function will be loaded once only, whenever the Shiny server instance is launched (for more on running your own Shiny server see Chapter 7, Sharing Your Creations). When you're running programs locally, the server instance is launched every time the program is launched, so for local applications, there is no difference between this and data loaded within the shinyServer() call.

When running on a real server, however, the server will be launched once and left running for months. As a consequence, this first method is a good place to perform very...