Chapter 4. Shiny Structure – Reactivity Concepts

Before diving deep into the different possibilities that Shiny provides, it is necessary to have a clear understanding of what Shiny is. For this reason, this chapter covers its central concepts with a special focus on reactivity and explains the structure of their implementation.

In short, we will cover the following topics:

  • Shiny as a package
  • An introduction to server.R and UI.R
  • The concept of reactivity
  • Reactive independent processes within an application
  • An introduction to global.R
  • Running a Shiny web application
  • An overview of simple examples

Shiny as a package

In Chapter 1, Introducing R, RStudio, and Shiny, we learned that Shiny is a package. Packages in R, in most cases, are a collection of functions (in some cases, also datasets) that serve certain objectives. For example, the glm package provides the necessary functions to run general linear models. Packages can also use functions from other packages. In this case, it is said that these packages depend on the package/s that contain the functions that are being used.

Shiny is then a package that contains a set of functions to build web applications within R. However, Shiny is a special package in the following two ways:

  • Firstly, for the correct use of its functions, it is necessary to organize the files in a specific structure
  • Secondly, the syntax of its functions is also slightly different
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset