Im trying to run a scrip of PCA but, in my data frame, i have a lot of dates of soil components with different numbers of repetitions. For example: soil pH, 3 observations for all areas; soil Ds, 4 observations for all areas.
The problem is, when i run the scrip, the variables that no have 4 observation, the Rstudio imputed this 'new four value' with the mean of the observations . I dont want it happen.
What i need to do?
PCA_TOTAL <- read_excel("C:/analises/pca/PCA_total.xlsx")
df = PCA_TOTAL
res.pca = FactoMineR::PCA(df[,(-1:-5)], graph = FALSE)
In FactoMineR::PCA(df[, (-1:-5)], graph = FALSE) :
Missing values are imputed by the mean of the variable: you should use the imputePCA function of the missMDA package