Skip to content
R for the Rest of Us Logo

This lesson is locked

Get access to all lessons in this course.

If the video is not playing correctly, you can watch it in a new window

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

Your Turn

In RStudio, first install the following packages with:

install.packages("remotes")
install.packages("shiny")
install.packages("fivethirtyeight")
install.packages("plotly")
install.packages("usethis")

To download the course materials, you then run:

library(usethis) use_course("rfortherestofus/shiny-course")

It will ask you if you want to download the course into a specific folder. If you don’t like that folder, you can specify a different location using the destdir argument. For example, if I wanted to install it into my Code/ folder in /Users/tedladeras/:

usethis::use_course("rfortherestofus/shiny-course", destdir="/Users/tedladeras/Code/")

You’ll need to pick the option that means “yes” (the prompt is to make sure that you’re paying attention to the questions, the order is switched up every time.)

It will then ask you if you want to delete the Zip file. You don’t need this, so select the option that means “yes” again:

Now you should be ready for the course. Let’s do a quick check to make sure that we’re up and running:

library(shiny)
runApp("test_app")

If everything is successful, you should see a window open up:

Confirm the app works by moving the slider, and then close the window. You should be all set up for the course.

Opening the Project Later

There are two ways to reopen the project. The first is to open the project selector in the top right of the RStudio window. There you can select the project (it will have a slightly different name - the last part will be different):

The other is to open the shiny-course.Rproj file in your file explorer or finder:

Resetting the course

In case you accidentally delete things, you can download a new copy with course materials using use_course() again. It will download a fresh copy as a new project. The old project will remain, with a new id:

library(usethis) use_course("rfortherestofus/shiny-course")

Organization of the Course Materials

There are four folders corresponding to the four parts of the course. In order, these are:

basics/ reactives/ plotly/ quarto/

When you watch the “Your Turn” section of the videos, you’ll open the corresponding assignment number in the corresponding folder (it will make more sense when you start watching the videos).

Sometimes the assignments will be about adding code to an existing shiny app, or thinking through a particular question.

Hope you enjoy the course!

Learn More

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Corey Sparks

Corey Sparks

April 19, 2024

When I install the materials, I can load the project, but the runApp("test_app") returns an error: Error in shinyAppDir(): ! No Shiny application exists at the path "test_app"

If I manually open the app.R file in the test_app folder, the app that runs is not the geyser app, but one asking me to select a categorical variable

Ted Laderas

Ted Laderas

April 19, 2024

Pending approval

Hi Corey,

I've switched back the app to the old faithful geyser app.

Make sure that you have opened the .rproj file to open the project, as runApp() gets confused if you're not in a project.

Let me know if that doesn't work.

Ted

Yuri Zharikov

Yuri Zharikov

April 23, 2024

I get this error when try to open the project Error in file.exists(pythonPath) : file name conversion problem -- name too long?

Yuri Zharikov

Yuri Zharikov

April 23, 2024

But the App runs when loaded and run manually

David Keyes

David Keyes Founder

April 24, 2024

Ok, that's strange. Glad it worked for you!

Michael Laviolette

Michael Laviolette

April 30, 2024

When I run the test app, I don't get the slider; just a dropdown with number of bins 10, 20, 35, 50. Wes the test app changed since the video?

David Keyes

David Keyes Founder

May 1, 2024

Sorry about that! I'm conferring with Ted on this. Will get back to you ASAP.

Ted Laderas

Ted Laderas

May 1, 2024

Pending approval

The test app was switched out. I've adjusted the current version to use the slider instead