Last time: Data frames and apply

Part I

Plot basics: ggplot

Plotting in R

There’s 2 major styles of plotting in R. You’ve already seen examples of base R plots include

But… the R community has come to embrace a new approach to visualization from the ggplot2 package.

Extremely popular graphics library

Base graphics

Why ggplot2?


Basics: some terminology

Introduction to dataset

library(gapminder)
data(gapminder)