I want to color the points by group in ggplot. Used lot of options but nothing helped and the points still black or have a another single color. I found the option to set inherit.aes = FALSE, but that don't helped and still have the Error "Error in FUN(X[[i]], ...) object 'Legend' not find" That's my Code:
theme_set(
theme_minimal() +
theme(legend.position = "right")
)
scores$condition <- c(rep("Col.mock", 6), rep("Col.treated", 6), rep("sid2.mock", 3), rep("sid2.treated", 3), rep("ald1.mock", 3), rep("ald1.treated", 3))
pca_p<-ggplot(data = scores, aes(x=PC1, y=PC2, color = Legend)) +
geom_point(size=3) + geom_text_repel(aes(label=condition), size=3) +
labs(x= paste0("PC1 (", s$importance[2,1]*100,"%)"),
y= paste0("PC2 (", s$importance[2,1]*100, "%)"))
pca_p
If I delete the "color= Legend" everything works, except the colors what I also want to have is a legend, but that doesn't work at all Can please someone help me?