How to add names to PCA map plot

Hi to everyone,
How can I add names from first column to my PCA map plot? Need help

library(ggplot2)
library("FactoMineR")
library("factoextra")
decathlon2<- read.csv("PCA2_data.csv", TRUE, ",")

decathlon2.active <- decathlon2[1:414, 1:10]
head(decathlon2.active[, 1:10], 414)

res.pca <- PCA(decathlon2.active, graph = FALSE)

Color by cos2 values: quality on the factor map

fviz_pca_var(res.pca, col.var = "cos2",
gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
repel = TRUE # Avoid text overlapping
)

fviz_pca_ind(res.pca, col.ind = "cos2",
gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
repel = TRUE # Avoid text overlapping (slow if many points)
)

Link to excel data

I get this error when include first column (name sex) as stated in above codes: Error in PCA(decathlon2.active, graph = FALSE) :
The following variables are not quantitative: Sex

Thanks for posting here on community! Just as a heads up, I've moved this to the general category as it's more of an R stats question and wanted to get more eyes on it here!

you need to tell PCA to exclude this variable or use it as supplementary or if you want it to be included in the analysis used a method that can handle a mix of quantitative and qualitative variables like FAMD

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.