Hi,

I am working on the expression datasets that has multiple-variables. I am using the `FactoMineR` and `pca3d` libraries for this purpose and was able to distinguish two factor levels belonging to a one variable column. However, I am not able to perform the PCA on the two variable columns that has different factor levels. Please let me know how can I do the PCA on multi-variable.

Below is the code I have ran with the one variable column;

    Neg_Dct
    ## Column [1-4 and 269-272] of the data set contains variables/categorical data##
    df = Neg_Dct[,-c(1:4, 269:272)]


    library(FactoMineR)
    nb_1 = estim_ncpPCA(df,ncp.max=5)
    res.comp_1 = imputePCA(df,ncp=2)
    res.pca_1 = PCA(res.comp_1$completeObs)

    library(pca3d)
    Node <- res.comp_1$completeObs
    pca <- prcomp(Node, scale.=TRUE)
    gr <- factor(Neg_Dct[,272])
    summary(gr)
    B_1   B_2 
     31     132 
 
    #2D plot##
    pca3d(pca, group=gr)
    
    #2D plot##
    pca2d(pca, group=gr)


Thank you,

Toufiq
Use PCAtools (I am the developer), where you can have as many levels as you want, and represent them as both different shapes and / or colours: <a href="https://bioconductor.org/packages/devel/bioc/vignettes/PCAtools/inst/doc/PCAtools.html#change-shape-based-on-tumour-grade-remove-connectors-and-add-titles">4.2.3 Change shape based on tumour grade, remove connectors, and add titles</a>

<a href="https://ibb.co/5G4K7GT"><img src="https://i.ibb.co/7jCk9jv/kkkk.png" alt="kkkk" border="0"></a>