I am trying to create a boxplot with the data frame grades_software
, software
as a discrete variable X (R/SPSS) and grades
as a continuous variable Y.
I used the following code:
library(ggplot2)
ggplot(grades_software, aes(software, grades_software$final_score)) +
geom_boxplot(fill = fill, colour = line) +
scale_y_continuous(name = "final_score",
breaks = seq(0, 175, 25),
limits=c(0, 175)) +
scale_x_discrete(name = "software") +
ggtitle("Distribution of Final Course Scores by Software Used")
However, I get the error stated above:
Aesthetics must be either length 1 or the same as the data (100): x, y
I also don't know what's the function of putting breaks = seq
and limits
in the code.