I'm trying to colour certain points of a scatter plot in R using logical arguments. My data is a function of sex( M/F ) and faculty (A/M/S/E). I want to colour each faculty, say green, red, blue, black, and then have the females showing as outline only, with a white center.
plot(year, logit.prop, type="n", xlab="Year of graduation", ylab="Logit proportion of survivors", ylim=c(-1,3))
points(year[faculty=="M"], logit.prop[faculty=="M"], pch=21,
points(year[faculty=="A"], logit.prop[faculty=="A"], pch=21, bg="red", col="red")
This is a section of the code i'm currently using, is there a way to tell R to colour points where the x axis value (thats year here) is both female and A?