I did a principal component analysis and now I'm plotting the results in R (plotting the first versus the second principal components of 2514 individuals, and coloring all those points regarding 6 superpopulations to visualize the clusters). R default colors are nice, but I need that one superpopulation in particular stands out, so I want to color it black. I don't care about the colors of the other 5.
I'm having trouble to apply what I've read about customizing color palettes and plotting with ggplot. I tried to create a new palette, but I'm having trouble mixing the both things in the syntax. I have to tell the program (1) color every dot concerning it's Superpopulation information, and (2) use this new color palette, mypalette, but in the plotting syntax both infos have to be in the "col" argument, but I want to put two. Here's the code so far, which's not achieving what I want:
Superpopulations<-PC$Superpop
mypalette=c("blue","violetred1","green1","darkorchid1","yellow1","black")
mypal=discrete_scale(aesthetics = Superpulations, scale_name = "Superpopulations", palette = mypalette)
superpopulation<-qplot(newPC2$PC1,newPC2$PC2, col=mypal, main = NULL ,xlab= NULL, ylab=NULL, size=I(2.5))
superpopulation + theme(legend.position="bottom")
I also tried extracting only the URUS and using the command points() to plot them alone in black over the other points:
points(PCsurus2$PC1, PCsurus2$PC2, col="black")
But I don't see any changes in the plot.
PC is a data frame where the first two columns are principal component values 1 and 2, and other column is Superpop, with the name tags of the superpopulations (like "URU", "EUR").
And here I leave the graph.
I want to change the URU colors from red to black to highlight that population

pointsonly works for base plot not forgridbased graphics such asggplot2(it will do nothing). - Axeman