Chapter 3 Introduction

In this section, we will

  • Get experience asking interesting questions, and developing a strategy to answer those questions using data
  • Gain comfort with coding and working hands-on with data
  • Practice interactive data exploration and visualization with base R, tidyverse (mostly dplyr and ggplot2), plotly, and other tools.

Packages and functions:

  • dplyr
    • filter, select, mutate, rename, summarize, arrange, group_by, *_join, pivot_longer, pivot_wider, ifelse, case_when
    • String multiple commands together with pipe operator
  • ggplot
    • geom_’s: geom_point, geom_jitter, geom_smooth, geom_line, geom_bar, geom_histogram, geom_tile, geom_segment, geom_text
    • facet_wrap, facet_grid
  • ggplotly and plotly
  • pubtheme, a package that contains a ggplot theme theme_pub and a plotly layout called layoutpub for creating data journalism-style data visualizations with color palettes and formatting similar to those used by media organizations like BBC, NY Times, and ESPN.
  • DT

We will assume basic familiarity with dplyr and ggplot2 functions. See Appendix for a refresher or an introduction.