In my DATA
below, I simply need to plot the Year
(a factor) on the x-axis, and Attendence_Rate
(a numeric) on the y-axis.
The plot is, however, so wonky. Am I missing something?
library(ggplot2)
ggplot(DATA) + aes(x = Year, y = Attendence_Rate, group = Group,
color = Group) +
geom_line() +
geom_point()
DATA <- structure(list(Group = c("All Students", "All Students", "All Students",
"All Students", "All Students", "All Students", "All Students",
"All Students", "All Students", "All Students", "All Students",
"All Students", "All Students", "All Students", "All Students",
"Current ELs", "Current ELs", "Current ELs", "Current ELs", "Current ELs",
"Current ELs", "Current ELs", "Current ELs", "Current ELs", "Current ELs",
"Current ELs", "Current ELs", "Current ELs", "Current ELs", "Current ELs",
"Former ELs", "Former ELs", "Former ELs", "Former ELs", "Former ELs",
"Former ELs", "Former ELs", "Former ELs", "Former ELs", "Former ELs",
"Former ELs", "Former ELs", "Former ELs", "Former ELs", "Former ELs",
"Never ELs", "Never ELs", "Never ELs", "Never ELs", "Never ELs",
"Never ELs", "Never ELs", "Never ELs", "Never ELs", "Never ELs",
"Never ELs", "Never ELs", "Never ELs", "Never ELs", "Never ELs"
), Gradeband = c("Elementary", "Elementary", "Elementary", "Elementary",
"Elementary", "High", "High", "High", "High", "High", "Middle",
"Middle", "Middle", "Middle", "Middle", "Elementary", "Elementary",
"Elementary", "Elementary", "Elementary", "High", "High", "High",
"High", "High", "Middle", "Middle", "Middle", "Middle", "Middle",
"Elementary", "Elementary", "Elementary", "Elementary", "Elementary",
"High", "High", "High", "High", "High", "Middle", "Middle", "Middle",
"Middle", "Middle", "Elementary", "Elementary", "Elementary",
"Elementary", "Elementary", "High", "High", "High", "High", "High",
"Middle", "Middle", "Middle", "Middle", "Middle"), Year = structure(c(1L,
2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L,
3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L,
4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L,
5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L), levels = c("SY1718",
"SY1819", "SY2021", "SY2122", "SY2223"), class = "factor"), Attendence_Rate = c(84.3,
84.4, 80.7, 67.7, 64.3, 70.7, 71.3, 60.6, 56.8, 56.6, 81.3, 80.8,
70.7, 66.5, 64.7, 82.8, 82.1, 72.2, 60.3, 58.3, 63.4, 62.6, 42.4,
43.5, 44, 78, 76.2, 52, 56.1, 56.2, 90.2, 89.4, 83.8, 76.1, 75.2,
68.9, 68.7, 54.9, 52.8, 53.7, 84.1, 84.3, 69.2, 68.8, 66.8, 84.2,
84.5, 82.1, 68.7, 64.9, 71.4, 72.2, 62.8, 58.5, 58.1, 81.1, 80.6,
72.6, 67.3, 65.4)), row.names = c(NA, -60L), class = "data.frame")