Error in apply(Lg[group.actif, ], 2, sum):dim(X) must have a positive length

425 views
Skip to first unread message

Emma Hernandez-Sanabria

unread,
Aug 21, 2017, 12:48:11 PM8/21/17
to factomin...@googlegroups.com, francoi...@agrocampus-ouest.fr
Hello users,

I am trying to run a MFA on the data attached and I have no idea why I am getting the following error:

Error in apply(Lg[group.actif, ], 2, sum) : 
  dim(X) must have a positive length

My code is the following:

res2 <- MFA(julich,
           group = c(1,126),ncp=5,
           type = c("n","s"),
           name.group = c("fer","bacterial"),
           num.group.sup = c(1))

Only the first variable is quantitative (type of fertilizer) and the rest are numerical. However, it seems that the error has to do with having an empty data frame. Has anyone had a similar issue? If that is the case, were you able to fix it? This is the first time I encounter this error, and I am struggling to find out a solution. I will appreciate any input.

Again, thanks for your time!

Emma 

--
Emma Hernandez Sanabria
tomatoroots.csv

François Husson

unread,
Aug 27, 2017, 8:48:17 AM8/27/17
to FactoMineR users, francoi...@agrocampus-ouest.fr
Hello,

You only have 1 group as active since you have 2 groups and one of them is a supplementary one. So, you should use a PCA and consider as the first variable of your dataset as a supplementary qualitative variable.
MFA is useful when several groups are considered as active.
FH
Reply all
Reply to author
Forward
0 new messages