Setup

We are excited to have you join us for our two-day workshop Building Production-Quality Shiny Applications! The format of the workshop will be a mix of presentation slides, example Shiny applications, and hands-on exercises. To ensure you are ready for the journey, please review the following instructions.

Pre-Work

This workshop will be a blend of teaching materials, live-coding demonstrations, and hands-on exercises to practice key concepts. RStudio has generously provided us access to a dedicated workshop coding environment using RStudio Cloud, which is accessible with a modern web browser such as Google Chrome, Microsoft Edge, Firefox, or others. In addition, RStudio is also providing a dedicated instance of the RStudio Connect platform for hosting Shiny applications that you create and view throughout the workshop.

In the first session of the workshop, we will allocate time for everyone to configure their accounts and development environments. If you would like to complete these steps before the workshop, you can follow the procedures detailed in Environment Configuration below.

Accounts

  • GitHub account: You can create a GitHub account for free using the instructions provided in the Register for GitHub chapter of Jenny Bryan’s Happy Git and GitHub for the UseR. If you already have an account, you are welcome to use it for the workshop. While version control itself is not a major focus of the course, we will discuss how certain elements can play an important role in application development and deployment. A great resource for getting a basic familiarity with Git version control is Jenny Bryan’s Happy Git and GitHub for the useR online book.
  • RStudio Cloud account: Visit rstudio.cloud and click the Sign Up link. Then create a Free account. If you already have an account, you do not need to create a new one.

Local Clone of Repository

If we encounter any technical issues with the cloud-based environments, it is a good idea to have a clone of this repository on your local laptop as a backup.

Environment Configuration

Please view the information in the callouts below for step-by-step instructions on configuring your accounts and environments. While RStudio Cloud is the preferred development environment, you may utilize your local installation of R and RStudio if you prefer.

View screenshots in full screen

  1. Create an account on the workshop RStudio Connect server by visiting https://rsc.training.rstudio.com and clicking the login link in the upper right corner.
  2. You will see a window that asks for either an email/password or to use a GitHub account. Please choose the GitHub option and follow the instructions to authorize RStudio Connect to your GitHub account.
  3. You should now be logged in to RStudio Connect. Please create an API key for your account by following the RStudio Connect User Guide instructions on creasting an API key. Save it to a secure place as you will need it for account integration.

View screenshots in full screen

  1. Join the RStudio Cloud Workspace dedicated to this workshop by visiting this customized invitation URL. If you already have an RStudio Cloud account, you are welcome to use it for the workshop. Otherwise, you can create a new account for free.
  2. You will see a project called shiny-prod-apps. Open that project and create a saved copy. This process could take a couple of minutes depending on server load.
  3. After the project loads, you will see messages in the R console about restoring or repairing the package library. Execute renv::restore(prompt = FALSE) to install packages into the project. This process should complete in one or two minutes.

If you prefer to use a local installation of R and RStudio, ensure you setup meets the following requirements:

View screenshots in full screen

  1. Navigate back to your RStudio Project created earlier. Create a new file called .Renviron withing your project directory by running the following in the R Console: usethis::edit_r_environ(scope = "project")
  2. Inside the .Renviron file, add the RStudio Connect URL and your account API key using the following format (substitute values as appropriate)
CONNECT_SERVER=https://rsc.training.rstudio.com
CONNECT_API_KEY=abcdefghijklmnopqrstuvwxyz
  1. Link your RStudio Connect account to RStudio by going to Tools -> Global Options -> Publishing and click Connect to follow the prompts.
  2. Restart your R session by going to Session -> Restart R inside RStudio. Verify that your environment variables were successfully registered by printing them into your R console with the following commands:
Sys.getenv("CONNECT_SERVER")
Sys.getenv("CONNECT_API_KEY")