1
Why R?
1.1
What is R?
1.2
Why use R?
1.3
Why not use R?
1.4
R License and the Open Source Ideal
2
R Mechanics
2.1
Installing R
2.1.1
Windows
2.1.2
Mac
2.1.3
Linux
2.2
Starting R
3
First steps
3.1
Interacting with R
3.2
Rules for Names in R
3.3
Resources for Getting Help
4
Introduction to R data structures
4.1
Vectors
4.1.1
Creating vectors
4.1.2
Vector Operations
4.1.3
Logical Vectors
4.1.4
Logical Operators
4.1.5
Indexing Vectors
4.1.6
Indexing Vectors and Logical Vectors
4.2
String Handling in R
4.2.1
Concatenating Strings
4.2.2
More String Functions
4.3
Special Data Types
4.3.1
Missing Values, AKA “NA”
4.3.2
Factors
4.3.3
Factors in Practice
4.3.4
Factors in Practice
5
Rectangular Data
5.0.1
Matrices and Data Frames
5.1
Matrix Operations
5.1.1
Matrix Operations
5.1.2
Matrix Operations
5.1.3
Matrix Operations
5.2
Data Frames
5.2.1
Matrices Versus Data Frames
5.2.2
Matrices Versus Data Frames
5.2.3
Data Frames, Continued
5.2.4
Exercise: Subsetting Data Frames
5.3
Basic Textual Input and Output
5.3.1
Reading and Writing Data Frames to Disk
5.4
Lists and Objects
5.4.1
Lists
5.4.2
Lists in Practice
5.4.3
Lists in Practice
5.4.4
Summary of Simple Data Types
5.4.5
Summary of Aggregate Data Types
6
Plotting and Graphics
6.1
Basics of Plotting
6.1.1
Basic Plot Functions
6.1.2
Simple Plotting Example
6.1.3
More Plotting
6.1.4
More Plotting
6.1.5
Graphics Devices and Saving Plots
6.1.6
More Plotting
6.1.7
R Graphics Galleries and Resources
7
Control Structures, Looping, and Applying
7.1
Control Structures and Looping
7.1.1
Control Structures in R
7.1.2
Control Structure and Looping Examples
7.1.3
Control Structure and Looping Examples
7.2
Applying
7.2.1
Why Does R Have Apply Functions
7.2.2
Apply Function Exercise
7.2.3
Related Apply Functions
7.2.4
Related Apply Function Examples
8
Functions
8.0.1
Function Overview
8.0.2
Example Functions
8.0.3
Further Reading
9
RStudio
: A Quick Tour
10
R
: First Impressions
10.1
R
Data types: vector and list
10.2
Classes: data.frame and beyond
10.3
Help!
11
Exercise 1: BRFSS Survey Data
12
Exercise 2: ALL Phenotypic Data
13
Exploration and simple univariate measures
13.1
Clean data
13.2
Weight in 1990 vs. 2010 Females
13.3
Weight and height in 2010 Males
14
Multivariate analysis
14.1
Input and setup
14.2
Cleaning
14.3
Unsupervised machine learning – multi-dimensional scaling
15
Using
R
in real life
15.1
Organizing work
15.2
R
Packages
16
Graphics and Visualization
16.1
Base
R
Graphics
16.2
What makes for a good graphical display?
16.3
Grammar of Graphics: ggplot2
Background
9
RStudio
: A Quick Tour
Panes
Options
Help
Environment, History, and Files