Using the FactoMineR package, I performed PCA on a biological dataset, where each column is a gene (n = 15) and rows are the different samples. There are a number of columns of categorical variables (columns 16 to 20, for example control/treatment and cancer/noncancer), which I included as qualitative supplements.
res.pca = FactoMineR::PCA(dataset, scale.unit=TRUE,
ncp=6,
quali.sup= c(16:20),
graph=FALSE)
The correlation (squared) is computed between the coordinates of the samples (individuals in FactoMineR terms) and the categorical variable expressed as numeric factor levels.