1 Lab 1: Introduction to R and RStudio

The course tools for the lab include the software programs R and RStudio.

1.1 Learning Outcomes

Students will be able to:

  1. Know the difference between R and RStudio, how to run the applications, and which one to use choose
  2. Identify the various panes and tabs in RStudio
  3. Use the Console tab to run commands
    1. Locate the command prompt in the Console tab
    2. Run a command
    3. Locate the output after running a command
    4. Distinguish between a clean prompt and a waiting prompt, and clear a waiting prompt
    5. Scroll through previous commands with the up and down arrows
  4. Use the History tab to view previous commands and copy them to the console
  5. Run commands using arithmetic operators
    1. Know the basic arithmetic operators +, -, /, *, ^
    2. Use them to perform mathematical computations
    3. Understand the order of operations and manipulate it using parentheses
  6. Use simple functions
    1. Use the basic arithmetic functions for square root sqrt() and absolute value abs()
    2. Identify objects as functions or values
  7. Work with objects
    1. Use the assignment operator <- to assign values to objects
    2. Print objects in the console by running their name
    3. Print objects in the console using the print() function
    4. Locate the Environment tab and identify objects in the environment
    5. List objects in the environment using the ls() function
    6. Remove some or all objects from the environment using the Environment tab
    7. Remove some or all objects from the environment using the rm() function
  8. Distinguish between values, objects, and functions

1.2 Assignment

  1. Follow along as your instructor introduces you to R and RStudio
  2. Keep written notes of how to complete each step
  3. Conduct a self-assessment of the learning outcomes listed above. Report the outcome to your instructor.

1.3 Checklist

Check your skills and comprehension; you should be able to do the following:

  • Use the Windows operating system
    • Run programs
    • Work with folders and files
  • Use R
    • Work in the R Console
    • Do math
    • Work with objects in the global environment