Skip to main content

User Guides


Get Started with the RStudio Lab


RStudio Interface

When you enter the RStudio lab, you will see the interface shown below, including watermarks displaying your account information and the lab launch time.

In the top-right corner, the Remaining Time timer will show the countdown of your available lab time.

The RStudio interface consists of four main panels:

RStudio Interface-Student.png

  1. Script Editor (top-left): This is where you write and edit your R code.
  2. Console (bottom-left): The Console displays the output of the code you run, which allows you to see results immediately.

Script editor and console highlighted on RStudio interface

  1. Environment and History (top-right): Environment shows the variables and data frames you create or import. History lists the commands you have previously executed.

Environment and history section highlighted on RStudio interface

  1. Files, Plots, and Packages (bottom-right): Files tab displays the files saved in your lab workspace.

Files tab on RStudio interface

Plots tab shows any plots or visualizations you create.

Plots tab on RStudio interface

Packages tab lists all R packages installed in your lab workspace. You can click the checkbox next to a package to load it for use in your session.

Packages tab on RStudio interface

Create and Open a File

To create a new file, click the icon on the top‑left toolbar next to the R logo, or open the File menu and select New File. Then choose the type of file you want to create.

File menu on RStudio

To open an existing file, go to the File menu on the toolbar. Alternatively, you can use the Files tab in the bottom-right panel and double-click the file you want to open.

Open files in RStudio lab

Load the Embedded Dataset

In a DAP lab, datasets are embedded within your workspace. Depending on how your lab is set up, you may encounter one of the following situations:

  • A pre-uploaded file with data-loading code

Some labs include a file that already contains the code needed to load the dataset.

To read the dataset, open the pre-uploaded file and run the code inside it to load the data into your environment.

image074.png

  • No Pre-written File Available

If your lab does not include a preloaded data-loading file, you can write your own code to load the dataset.

For step-by-step guidance, open the Instructions panel on the lab launch page. It includes example code that you can copy into your R script and run it to locate and load the embedded dataset.

Instructions panel entrance

instruction panel

Save a File

To save the file, click the Save icon on the Toolbar, or select “Save” from the File menu:

file-saving menu

name the file and save

You can check the Files tab to confirm that your file has been successfully saved.

saved file under Files tab