Sure thing! Thank you for the tip, you're right that makes it much easier.
Here's the code:
library(tidyverse)
library(ggforce)
library(ggplot2)
employee <- c('JD','PG','JH', 'JJ','AA', 'BB')
salary <- c(21000, 23400, 26800, 27000,21500, 25500)
employ.data <- data.frame(employee, salary)
ggplot(data = employ.data) +
aes(y = salary, x= "Employees")+
ggforce::geom_sina(col=ifelse(employ.data$salary>=22000, rgb(255,0,0,120,maxColorValue=255),rgb(0,0,0,100,maxColorValue=255))) +coord_flip()+
geom_abline(intercept=22000,slope = 0,lty=2)+
theme_minimal()+theme(axis.line = element_line(colour = "black", size = 0.5,
linetype = "solid"))+
scale_y_continuous(breaks=seq(20000,25000,28000))+ labs(y="Salary")
I guess I might have to create a separate variable that answers the question Is the employee on the 'promotion list' and maybe use that?