Goals of this Lesson:
- Use the basic commands:
c( ) ls( ) rm( ) mean( ) median( ) sd( ) summary( )
- Create a R script
-
-
- Use # to write comments.
- Execute commands via an R script (a file with file extension .R).
-
Instructions
- Watch the following video BEFORE you do your R2 assignment. While the video demonstration below uses a Mac, both PC and Mac users will see a very similar screen layout in the R Console.
Lesson 2 — Basic commands & scripts
(After watching the video, you are ready to do your second R assignment — go back to Canvas and click the assignment item R2.)
2) If you notice that your screen layout looks very different than that shown in the video, that probably means that you are using the RStudio instead of the R Console.
For PC users, in case you cannot find the menu option to save your script, please watch the following video at the timestamp 6:29 —
https://www.youtube.com/watch?v=Q3NxsSRxKek
3) If the file extension .R is not shown when you are saving the file in the R Console, it’s probably because your desktop is not set to show file extensions.
Here is how to set your desktop to show file extension:
For Mac:
https://support.apple.com/guide/mac-help/show-or-hide-filename-extensions-on-mac-mchlp2304/mac
For Window 10 on PC:
https://vtcri.kayako.com/article/296-view-file-extensions-windows-10
-END-