How to open and use R script files in RStudio Cloud
Video guideline:
Make sure you have a RStudio Cloud account. Otherwise, get one and install all the packages. See this guideline.
Textual guideline:
Open RStudio Cloud website and log in. Click "RStudio labs" under "Your content."
Download the R script file you need:
Go to Canvas ā Resources module page ā āLab resourcesā ā āAll R script filesā ā Click on the R Script file you need and download that file. āAll script filesā is here for your convenience.
For example, if you need the "Descriptive Statistics" R script file. Click on it and download:

Uploading R script files 1: On RStudio Cloud website, click āUploadā (see highlighted part #2 below).

Uploading R script files 2: Click āChoose File.ā Find the R script file you just downloaded (script_descriptive.R) in the previous step, click āOpenā and "OK."

Opening R script files: The file is uploaded and at the bottom of the "Files" list (see highlighted part #1). When you click on it, the descriptive R script file will open (see highlighted part #2).

Installing and loading packages: Whenever we open RStudio, we highlight all the lines under the āInstall and load packagesā (see highlighted part #1) and click run (see highlighted part #2).

Loading data: When the process of installing and loading packages is completed, we highlight all the lines under the āLoad dataā (see highlighted part #1) and click āRunā (see highlighted part #2). When you see āgssā and ākeyā (see highlighted part #3), it means we successfully installed and loaded the packages, and loaded the GSS data.

Running the analysis codes: We highlight the codes (see highlighted part #1) and click āRunā (see highlighted part #2). Clicking āRunā generates the analysis (see highlighted part #3).

Using R script files - āworking spaceā and outline view: We do not edit or change anything on R script files except under āworking spaceā(see highlighted part #1). Anything above the āworking spaceā is teaching material!
The codes for assignments will be put under the āworking spaceā
For easy navigation click āOutlineā (see highlighted part #2) to see the headings and subheadings.

Saving R script files: When we make any changes, the font of the file name (shown in the highlighted part #2 above) will be red with an asterisk (*) - (see the highlighted part #1 below). To save our progress, we click save (see the highlighted part #2 below)

Last updated