Data Visualization with R
Welcome
1
Introduction
1.1
Introduction
1.2
What is data visualization?
1.3
Why visualize data?
1.4
R Graphics System
1.4.1
Graphics
1.4.2
ggplot2
1.4.3
Lattice
1.5
Getting Help
1.5.1
mtcars
1.5.2
Variable Info
1.6
plot()
1.6.1
One continuous variable
1.6.2
One categorical variable
1.6.3
Two continuous variables
1.6.4
Two categorical variables
1.6.5
Continuous/Categorical variable
1.6.6
Categorical/Continuous variable
2
Title & Axis Labels
2.1
Introduction
2.2
Syntax
2.3
Title
2.4
Subtitle
2.5
Axis Labels
2.6
title()
2.7
Axis Range
3
Scatter Plots
3.1
Introduction
3.2
Basic Plot
3.3
Shape
3.4
Size
3.5
Color
4
Line Graphs
4.1
Introduction
4.2
Basic Plot
4.3
Color
4.4
Line Type
4.5
Line Width
4.6
Enhance Points
4.7
Additional Lines
4.8
Putting it all together…
5
Bar Plots
5.1
Introduction
5.2
Bar Plot
5.2.1
Using plot function
5.2.2
Using barplot function
5.3
Horizontal or Vertical
5.4
Bar Width
5.4.1
Equal Width
5.4.2
Different Widths
5.5
Labels
5.6
Color
5.6.1
Same color for all bars
5.6.2
Differnt color for the bars
5.6.3
Recycling colors
5.6.4
Same color for all bars
5.6.5
Differnt color for the bars
5.6.6
Recycling colors
5.7
Axes
5.7.1
Remove axes
5.8
Putting it all together…
5.8.1
Title & Axis Labels
5.9
Bivariate Bar Plots
5.9.1
Stacked Bar Plot
5.9.2
Grouped Bar Plot
6
Box Plots
6.1
Introduction
6.2
Box Plot
6.2.1
Structure
6.3
Univariate Box Plot
6.3.1
Basic Plot
6.3.2
Horizontal Box Plot
6.3.3
Color
6.3.4
Border Color
6.3.5
Range
6.3.6
Outline
6.3.7
Varwidth
6.4
Bivariate/Multivariate Box Plot
6.4.1
Color
6.4.2
Compare Medians
6.5
Putting it all together
7
Histograms
7.1
Introduction
7.2
Distributions
7.2.1
Normal Distribution
7.2.2
Skewed Distributions
7.3
Basics
7.4
Bins
7.5
Intervals
7.5.1
Frequency Density
7.6
Frequency Distribution II
7.7
Color
7.7.1
Single Color
7.7.2
Different Colors
7.7.3
Recycled Colors
7.8
Border Color
7.8.1
Different Colors
7.9
Labels
7.9.1
Method 1
7.9.2
Method 2
7.10
Putting it all together..
8
Legends
8.1
Introduction
8.2
Data
8.3
Line Graph
8.4
Legend Location
8.5
Lines
8.6
Points
8.7
Text Placement
8.8
Title
8.8.1
Title Color
8.8.2
Title Position
8.9
Box Appearance
8.9.1
Box Type
8.9.2
Background Color
8.9.3
Border
8.10
Justification
8.10.1
Horizontal Justification
8.10.2
Vertical Justification
8.11
Text Appearance
9
Text Annotations
9.1
Introduction
9.2
Syntax
9.3
Text Inside the Plot
9.4
Color
9.5
Font
9.6
Font Family
9.7
Font Size
9.8
Text on the Margins
9.9
Specify Margin
9.10
Line
9.11
Alignment
10
Faceting
10.1
Introduction
10.2
Row
10.2.1
Case Study 1
10.2.2
Case Study 2
10.2.3
Case Study 3
10.2.4
Case Study 4
10.2.5
Case Study 5
10.3
Column
10.3.1
Case Study 6
10.4
Special Cases
10.4.1
Case Study 7
10.4.2
Case Study 8
10.5
Layout
10.5.1
Case Study 1
10.5.2
Case Study 2
10.5.3
Case Study 3
10.5.4
Case Study 4
10.5.5
Case Study 5
10.5.6
Case Study 6
10.5.7
Case Study 7
10.5.8
Case Study 8
10.5.9
Case Study 9
10.6
Putting it all together…
References
Published with bookdown
Data Visualization with R
References