Neat! Didn't know this ggplot feature. Thanks!
overlapping texts (plot.PCA in FactoMineR)
Hi, all!
I was trying to draw a PCA plot using FactoMineR (a R package). When I ran it, texts on the plots were overlapped with unknown numbers.
Here's the R code
library(FactoMineR)
pca<-PCA(dta.cor, scale.unit=T)
plot.PCA(pca,cex=1)
and the result plot

As you can see numbers in pink are covering sample names.
I couldn't figure it out.
Please, someone help me!!
Thank you!!!
• 13,701 views
•
link
1 answer
You can use prcomp for PCA calculations and then plot it using ggplot and add labels using ggrepel.
ggrepel provides geoms for ggplot2 to repel overlapping text labels. It works both for geom_text and geom_label.
Figure is taken from this blog post.
• 1 views
•
link
• 1 views
•
link
The labels are from ggrepel, a package by Kamil. ggrepel: repel overlapping text labels in ggplot2
• 1 views
•
link
Log in to answer this question.

You can explore the options by looking at the help.
?plot.PCAIt looks like it haslabel=andautoLab=options which may be useful to turn off the unwanted labels. Try to troubleshoot it yourself first, which is the best way to learn.Adding to other suggestions check
geom_text_repelformggrepelCheck its vignette hereThank you, all! You guys been great help!