Why the CA function in FactorMineR tells me that undefined columns are selected?

76 views Asked by At

I'm using a dataframe named DataUniv composed of 13 variables. When I try to run a correspondance analysis using FactoMineR :

dataUniv.CA = CA(dataUniv[,2:7],
             col.sup=c(1,8:13))

It sends me back this error :

Error in `[.data.frame`(Xtot, , col.sup) : undefined columns selected

I don't really understand why it sent me back this type of error, as it seems that those columns are effectively defined, if I run :

View(dataUniv[,2:7])
View(dataUniv[,c(1,8:13)])

It returns something good...

1

There are 1 answers

0
GaëtanLF On BEST ANSWER

I finally found it: the col.sup argument must contain columns that are included in the first argument.