I want to have a line to connect the points here.
Here is the code I have used:
library(dplyr)
library(ggplot2)
library(readr)
# Create a line chart with markers
ggplot(df, aes(x = USER_ALLIAS , y = AVERAGE_HEART_RATE)) +
geom_line(color = "blue", linetype = "solid") +
geom_point(color = "blue") +
geom_line(aes(y = MAXIMUM_HEART_RATE), color = "red") +
geom_point(aes(y = MAXIMUM_HEART_RATE), color = "red") +
#Connect the points
geom_path(aes(x = USER_ALLIAS, y = AVERAGE_HEART_RATE), color = "blue", linetype = "sold") +
geom_path(aes(x = USER_ALLIAS, y = MAXIMUM_HEART_RATE), color = "red") +
labs(title = "Average and Maximum Heart Rate per User", x = "User ID", y = "Heart Rate") `