global.R coding

While the previous section covered processes that had to be done only once whenever the data source changes, global.R will include all the actions that can be done just once per session, for example, see the following:

  • Data source loading
  • Library calls
  • Custom functions sourcing

In our case, apart from loading the dataset and calling the corresponding libraries, we will need to generate a vector that contains the names of all the categorical variables. This will be used in one of the variables selectors. Of course, this last step can be avoided and the list of variables can be hardcoded.

However, in terms of the application's maintenance, it is much wiser to do it this way because if the data source changes (for example, a new categorical ...

Get Learning Shiny now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.