How to graph 2 of the same variable, but from 2 different people on the same graph

Viewed 26

I am trying to track the peak velocity day to day, so eventually there will be more data points, but I want the 2 names to be different colors and not connected to eachother. The top data point is for "Ben" and the bottom data point is for "Pete". How do I change this. Here is my code and a picture of the plot and table.

Jump_vel_tracking <- ggplot(Jump_tibble, aes(x = date(), y = daily_max_vel, color = 'red3')) +
  geom_point() + 
  geom_line() +
  scale_y_continuous(breaks = seq(from = 3.5, to = 3.8, by = 0.1), limits = c(3.5, 3.8)) +
  labs(x = 'Date', y = 'Peak Velocity (m/s)', title = "CMJ Peak Velocity")

enter image description here enter image description here

1 Answers

Instead of letting color 'red3', set as athlete

Jump_vel_tracking <- ggplot(Jump_tibble, aes(x = date(), y = daily_max_vel, color = athlete)) +
  geom_point() + 
  geom_line() +
  scale_y_continuous(breaks = seq(from = 3.5, to = 3.8, by = 0.1), limits = c(3.5, 3.8)) +
  labs(x = 'Date', y = 'Peak Velocity (m/s)', title = "CMJ Peak Velocity")
Related