Chapter 2 Purpose

The purpose of this tutorial is to start building and strengthening foundational coding skills in R. We take a functional and active approach to learning R. We believe that the easiest way to learn R is by using R. Giving you some building blocks and suggesting some strategies for overcoming common coding obstacles will allow you to begin exploring the language. You never need to actively memorize code chunks or functions. You will become proficient naturally with many hours of practice. Therefore, the goal of this tutorial is to expose you to what R can do so that you know what tools you have at your disposal when you are later working through a problem.

Today’s tutorial will cover:

  1. How to download and install R and RStudio
  2. The panes of RStudio
  3. How to create and use R Markdown Documents
  4. Arithmetic commands
  5. (Some of) the different types of variables in R
  6. What functions are and how to use them
  7. How to install and load packages and…
  8. How to import data into R

At the end of this tutorial is a set of Minihacks. Minihacks are small coding exercises intended to test your knowledge of the day’s material.

Note: This tutorial has been modified from labs created by Cameron Kay and Sarah Dimakis for PSY 611 (Data Analysis I; Fall 2020).