I am working on a project where I am comparing the Legislative Effectiveness Scores (LES) of female house members. I am trying to determine if Democratic female House members are more effective than Republican female House members. My data includes the LES for every house member from 1973-2015. I am trying to create a plot that ONLY shows female scores, where Democrat points are blue and Republican are Red.
I found some guidance online but cannot seem to get it to work for my data. Here is what I have been trying.
pick <- function(condition){
function(gender) d %>% filter_(Female)
}
ggplot(escores, aes(x=Year, y=LES, fill=gender))
geom_point(size = 4, shape = 4) +
geom_point(data = pick(~party == "Democrat"), color = "blue") +
geom_point(data = pick(~party == "Republican"), color = "red")
Any guidance would be appreciated!