Good morning, everyone,

I'm interested in the variability of color character in a Petunia factorial crossover design.

I have performed several PCA on individuals and I am now interested in the variables. I use the Factoextra packages, with the following codes:

res<- PCA(ACP_Petunia2020[,2:1737], scale.unit=TRUE, ncp=5, quali.sup =1736, graph=T)

fviz_pca_var(res)

My problem is the high number of variables (1735) does not allow me to interpret the circle of correlations, the graph is unreadable (see img below).

According to my research, the col.var parameter of the fviz_pca_var function allows to color the variables according to cos2 values, coordinates and axes. But it also allows to introduce a vector of values.

So I would like to color the variables according to their respective numerical values. The variables being wavelengths, it seems relevant to me to make a gradient from purple to red, for that I would use the following function:

scale_color_gradient2(low="Purple", mid="Green",high="Red", space ="Lab")

My question is how to create a vector whose components are the numerical values of each of the variables, but also how to ensure that each value is assigned to the right variable?

Thank you in advance.