What does “argument to 'which' is not logical” mean in FactoMineR MCA?

前端 未结 4 506
后悔当初
后悔当初 2021-01-04 10:40

I\'m trying to run an MCA on a datatable using FactoMineR. It contains only 0/1 numerical columns, and its size is 200.000 * 20.

require(FactoMineR)
result &         


        
4条回答
  •  没有蜡笔的小新
    2021-01-04 10:48

    Same problem as well and changing to factor did not solve my answer either, because I had put every variable as supplementary.

    What I did first was transform all my numeric data to factor :

    Xfac = factor(X[,1], ordered = TRUE)
    for (i in 2:29){
      tfac = factor(X[,i], ordered = TRUE)
      Xfac = data.frame(Xfac, tfac)
    }
    colnames(Xfac)=labels(X[1,])
    

    Still, it would not work. But my 2nd problem was that I included EVERY factor as supplementary variable ! So these :

    MCA(Xfac, quanti.sup = c(1:29), graph=TRUE)
    MCA(Xfac, quali.sup = c(1:29), graph=TRUE)
    

    Would generate the same error, but this one works :

    MCA(Xfac, graph=TRUE)
    

    Not transforming the data to factors also generated the problem.

    I posted the same answer to a related topic : https://stackoverflow.com/a/40737335/7193352

提交回复
热议问题