I am trying to plot reading time over a string of words, divided into 2 groups based on gender. I am able to create the following plot with the following code:
GA %>%
group_by(Gender) %>%
ggplot()+
aes(x=Word, y=Time, color=Gender)+
geom_point(stat = "summary", fun = "mean")
I would like to add a geom_line
to this image, that connects the points horizontally, with a separate line for each gender. However, when I use the following code, I get this image instead.
GA %>%
group_by(Gender) %>%
ggplot()+
aes(x=Word, y=Time, color=Gender)+
geom_point(stat = "summary", fun = "mean")+
geom_line()
Can anyone help me figure out what I am doing wrong? Thank you so much in advance. I tried using the "group" aesthetic within aes().