In order to run a Shiny web application, it is important to consider that UI.R
, server.R
, and, if needed, global.R
must be placed in the same folder. If an HTML document is used, a folder named www
must be created in the application folder to hold the HTML document. Additionally, it must be named index.html
.
There are three basic ways to run the applications. They are as follows:
runApp()
: This opens a browser and executes the application locally. It receives a string representing a directory as an argument. If no argument is provided, runApp()
defaults to the working directory.runGist()
/runGitHub()
: This works exactly as runApp()
, but instead of looking for the files locally, it connects to a gist or a GitHub repository, downloads the full application in a temporary file, and displays it in a web browser. This is explained in more detail in Chapter 10, Sharing Applications.rstudio-server
and shiny-server
installed is needed. Although the configuration of a public application is more complex than running it locally, it is definitely the most useful one as it enables access to almost any public application as only a web browser is needed. We will see more on this in Chapter 10, Sharing Applications.