I have this dataframe that I'm trying to make a vertical line on an x-axis that is categorical.
data <- data.frame(
condition = c('1', '1', '1', '1', '1', '2', '2', '2', '2', '2', '3', '3', '3', '3', '3'),
AssessmentGrade = c('400', '410', '420', '430', '440', '500', '510', '520', '530', '540',
'300', '310', '320', '330', '340'),
Freq = c('1', '2', '1', '5', '7', '9', '1', '5', '3', '4', '5', '8', '1', '3', '5'),
MathGrade = c('A+', 'B-', 'C-', 'D', 'F', 'A-', 'B', 'C+', 'D-', 'F', 'A+', 'D', 'D', 'F', 'C'),
Condition = c('Condition 1', 'Condition 1', 'Condition 1', 'Condition 1', 'Condition 1',
'Condition 2', 'Condition 2', 'Condition 2', 'Condition 2', 'Condition 2',
'Condition 3', 'Condition 3', 'Condition 3', 'Condition 3', 'Condition 3'))
I tried adding a field to make grade numeric and that helped
data$Gradenum <- as.numeric(data$MathGrade)
I used ggplot to get abubble graph but I was wondering how I would edit it to use my company's standard colors
p <- ggplot(data, aes(x = MathGrade, y = AssessmentGrade, size = Freq, fill = Condition)) +
geom_point(aes(colour = Condition)) +
ggtitle("Main Title") +
labs(x = "First Math Grade", y = "Math Assessment Score")
How can I get a vertical line between C+ and D? I see a lot of information out there if your x axis is a date but not for other categorical values