Wed Sep 28, 2016

5NG

Today:

  1. Scatterplot AKA bivariate plot
  2. Linegraph
  3. Boxplot
  4. Barplot AKA Barchart AKA bargraph
  5. Histogram

Example

Let's re-run our example from last time:

# Load packages
library(dplyr)
library(ggplot2)

# Create data frame
simple_ex <-
  data_frame(
    A = c(1, 2, 3, 4),
    B = c(1, 2, 3, 4),
    C = c(3, 2, 1, 2),
    D = c("a", "a", "b", "b")
  )

simple_ex

Example

A statistical graphic is a mapping of data variables to aes()thetic attributes of geom_etric objects.

Today

  • Drill down on geom_line()
  • How to have more than one line-graph on the same plot using the color aesthetic.
  • Introduce two techniques for smoothing. This allows us to separate the "signal" from the "noise"
    • General smoothing
    • Linear regression

Advanced: How do Smoothers Work?

By doing a local regression within a sliding window: GIF