husson / FactoMineR

Package FactoMineR
39 stars 8 forks source link

An issue of `predict.PCA` when setting `ncp` as 1 #11

Open jianzhaobi opened 2 years ago

jianzhaobi commented 2 years ago

Hi François,

When I set ncp to be 1 and use predict.PCA for PCA prediction, the function always reports an error crossprod(t(coord), object$svd$V) : non-conformable arguments.

I realized that it's an issue relevant to ncol and rownames in the function predict.PCA, which cannot properly deal with object$var$coord when it's a vector (i.e., when ncp == 1).

I would suggest debugging the lines with ncol and rownames in predict.PCA to let them better accommodate vectors.

I would really appreciate your time and help!

Best,

Jianzhao