3.4 Line chart: geom_line()

  • A geom that connects points from left to right.
    • linetype is a useful parameter.
    • Checkout the different linetypes here.
    • Also here ?linetype
ggplot(economics, aes(x = date, y = unemploy)) +
  geom_line()

  • What’s up with geom_path()?
    • Connects points as they appear in order of the data
    • Answer to exercise 2.
ggplot(df, aes(c, y)) +
  geom_path()

ggplot(economics, aes(unemploy / pop, psavert)) +
  geom_path()