scatter <- ggplot(examData, aes(Anxiety, Exam))
scatter + geom_point(aes(colour = Gender)) + geom_smooth(method = "lm")
If i execute the commands above, the graph shows up correctly with different color dots, however, if I follow my textbook and execute the commands below, I don't see different color dots.
satter <- ggplot(examData, aes(Anxiety, Exam, colour = Gender))
scatter + geom_point() + geom_smooth(method = "lm")
Can anyone help me (a absolute beginner) understand what am I doing wrong?
Thank you.