I have a dataset that shows median weekly earnings for people with different education levels over a 15 year period. I am trying to do a scatterplot of the values for each of two education levels, but for some reason my plot orders the y values of each education level separately and then stacks them.
I'm not sure if this is a problem with how I gathered the original values or with how I am generating the plot, but I have looked through this and a few other sites and I cannot figure out how to fix this. I have included the code below.
EdData <- read.csv("~/desktop/EdData.csv")
library(ggplot2)
library(tidyr)
library(dplyr)
EdData_Long <- gather(EdData, "Education", "Earnings", Weekly.Earnings.HS.Only, Weekly.Earnings.College, na.rm = FALSE)
ggplot(data = EdData_Long, aes(x = Year, y = Earnings, colour = Education)) + geom_point()
I'm pretty new to R, so I'm sorry if this is really basic. I promise I did try to find the answer before posting, but I do not even know the right terms to describe the problem I am having. Thanks in advance for any help you can offer.
In case it is helpful, I have posted the (very small) data set here