Lines logo ggplot: lines

1 2 3 4 5 6 7 8

Make sure that the following libraries are loaded before running other code.

library(ggplot2)
library(tidyverse)

There are two charts that we highlight in this video. Before running the code, try to predict what the result looks like.

Chart 1

ggplot() +
  geom_line(data=ChickWeight, aes(x=Time, y=weight))

Chart 2

ggplot() +
  geom_line(data=ChickWeight, aes(x=Time, y=weight, group=Chick))