Exercises 1 - RStudio Solutions

Files corresponding to Short Course: Introduction to Data Science Using R

Exercises 1 - RStudio Solutions

1.1 RStudio GUI

Task: Search the menus in your RStudio IDE to locate where each of the following can be accomplished:

  1. Restart your R Session
  2. Create a new “R Markdown” file
  3. Install lubridate packages (with dependencies if needed)
  4. search the Help to learn about the “head” function
  5. What types of data sources can be imported using the RStudio GUI

Solution

  1. RStudio >> Session
  2. RStudio >> File >> New File >> R Markdown
  3. RStudio >> Packages >> Install >> [type the package name in the search bar]
  4. RStudio >> Help >> [type “head” in search bar]
  5. RStudio >> File >> Import Dataset

1.2 Configuration for coding

Task: Visit “RStudio >> Tools >> Global Options” and locate the following:

  1. Pane Layout
  2. “Rainbow parenthesis”
  3. “Show margin” (set to 80)
  4. “Highlight selected line”
  5. “Provide R style diagnostics (e.g., whitespace)”
  6. “Show whitespace characters”

Solution

  1. Tools >> Global Options >> Pane Layout (in left-side navigation)
  2. Tools >> Global Options >> Code >> Display
  3. Tools >> Global Options >> Code >> Display
  4. Tools >> Global Options >> Code >> Display
  5. Tools >> Global Options >> Code >> Diagnostics
  6. Tools >> Global Options >> Code >> Display