In this unit, you will become familiar with the R console, RStudio, and basic actions and operations in R.
Follow the links to each lecture, lab, and reading.
Scroll down to download the SWIRL lessons.
Lecture: Overview of R, demonstration of R.
Learning Goals:
Lab: Unit 1: Lab 1
Reading: NYT article
Functions: None.
Lectures:
Learning Goals:
SWIRL: Basic building blocks
Lab: Unit 1: Lab 2
Reading:
Functions: <-
, getwd()
, setwd()
.
Lecture: Types of data and data structures
Learning Goals:
c()
, :
, seq()
, rep()
,plot()
.SWIRL:
Best Practice: Code style guide
Labs:
Functions: c()
, :
, seq()
, rep()
, plot()
, is.vector()
, etc
Lecture: Using functions
Learning Goals:
getwd()
and setwd()
,>
, <
, !=
, ==
),sum()
, mean()
, sd()
, etc.boxplot()
and hist()
.SWIRL:
Lab: Unit 1: Recap
Functions: getwd()
, setwd()
, sum()
, mean()
, sd()
, summary()
, length()
, boxplot()
, hist()
The lessons we will use are available online and you need to download them to your laptop.
Open RStudio
In the console panel, next to the arrow (>), copy and paste the following:
library(swirl)
install_course_github("intro2r", "swirl_courses", multi = TRUE)
This will download the most up-to-date lessons.
To start the lesson, type
swirl()
Updated 2018-08-29