Hi,
I'm running PCAtools on a cancer and control samples with this code:
bp1 <- PCAtools::biplot(pcaobj = PCA,
colby = 'group',
colkey = c(control = 'blue', cancer = 'pink'),
legendPosition = "right",
lab = NULL,
hline = 0, vline = 0)
geom_point(shape = 1,size = 3,colour = "black") +
theme(legend.title = element_blank(),
legend.position=c(0.9,0.9),
legend.background = element_rect(fill="white", size=.5, linetype="dotted"),
legend.box.background = element_rect(colour = "black"))
The error I'm getting is: Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.
Running the above code I get the plots, but they're just empty circles, however if I comment out colkey
I'll get the default colours. I'm not sure what I'm doing wrong here.
sessionInfo( )
R version 4.0.3 (2020-10-10) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Catalina 10.15.7
Hi,
Thank you! I feel so silly, my columns weren't
control
andcancer
I had labelled them as something else. It works now, much appreciated.Perfect, I'll adapt my code so I can omit using ggplot2, it was a bit of a rushed attempt at getting the graph to appear how I wanted it.
Thank you again!
No problem / Sin problema / Sem problema