Skip to content

Run a tutorial and exercise simultaneously

Justin edited this page Sep 11, 2020 · 1 revision

If you would like to refer to the tutorial while also working on this document, you may choose to open the HTML version of the tutorial (after closing it in RStudio) in a web browser to refer to the code. Because tutorials through learnr run as continuous R code, you cannot run R code while a tutorial is open.

You may also want to open both the tutorial and the R Markdown document in RStudio.

In RStudio Desktop (on your Mac or PC)

  1. In the top-most menu (i.e., the one with File, Edit, etc.), click on Session, and then on "New Session". This will open a second section of RStudio on your personal computer.

  2. In that new session, open one of the documents (either the tutorial, or open this document in it). You should be able to do so by going to File: Recent Files. Close the document in the first session. Alternate between sessions of RStudio.

Using separate sessions allows you to run multiple instances of R, meaning that you can keep the tutorial open while also running new code.

For RStudio.Cloud users

Folks using RStudio.Cloud can open the website in two tabs, and create a new project in the second tab. A new project will need to have all of the packages installed in Lab 1 installed there, too. Opening RStudio.Cloud in two browser tabs may use double the "processing" time and therefore may increase the likelihood of hitting your limit on use. (See their plans page for more information.) I recommend simply opening up the HTML document, but you can also track your usage under the Accounts tab.