Visualization with ggplot2

Case Study: Exploratory Data Analysis in R

Dave Robinson

Chief Data Scientist, DataCamp

By-year data

by_year
# A tibble: 34 × 3
    year total percent_yes
   <dbl> <int>       <dbl>
1   1947  2039   0.5693968
2   1949  3469   0.4375901
3   1951  1434   0.5850767
4   1953  1537   0.6317502
5   1955  2169   0.6947902
6   1957  2708   0.6085672
7   1959  4326   0.5880721
8   1961  7482   0.5729751
9   1963  3308   0.7294438
10  1965  4382   0.7078959
# ... with 24 more rows
Case Study: Exploratory Data Analysis in R

Visualizing by-year data

2-1.004.png

Case Study: Exploratory Data Analysis in R

Visualizing by-year data

library(ggplot2)
ggplot(by_country, aes(x = year, y = percent_yes)) +
    geom_line()
    year total percent_yes
   <dbl> <int>       <dbl>
1   1947  2039   0.5693968
2   1949  3469   0.4375901
3   1951  1434   0.5850767
4   1953  1537   0.6317502
5   1955  2169   0.6947902
6   1957  2708   0.6085672
7   1959  4326   0.5880721
8   1961  7482   0.5729751
9   1963  3308   0.7294438
10  1965  4382   0.7078959
# ... with 24 more rows

2019-08-22_22-32-08.png

Case Study: Exploratory Data Analysis in R

Let's practice!

Case Study: Exploratory Data Analysis in R

Preparing Video For Download...