estim_ncpFAMD error

56 views
Skip to first unread message

hathaiphat vongthaiwan

unread,
Nov 10, 2020, 4:16:40 AM11/10/20
to FactoMineR users
When I used this command in R

data(ozone)
result_ozone_test <- estim_ncpFAMD(ozone, method = "Regularized", method.cv = "loo")

I got this error

Error in if (!any(summary(jeuNA[, j] == 0))) { : missing value where TRUE/FALSE needed In addition: Warning message: In any(summary(jeuNA[, j] == 0)) : coercing argument of type 'character' to logical

How can I solve this problem? Which point is not correct?

Francois Husson

unread,
Nov 17, 2020, 7:54:08 AM11/17/20
to factomin...@googlegroups.com
When you read the data, be sure that you have a data-frame and not a tibble. Else do:
MyData <- as.data.frame(MyData)

FH


Le 10/11/2020 à 10:14, hathaiphat vongthaiwan a écrit :
When I used this command 

result_ozone_test <- estim_ncpFAMD(ozone, method = "EM", method.cv = "loo")

I got this error

Error in if (!any(summary(jeuNA[, j] == 0))) { : missing value where TRUE/FALSE needed In addition: Warning message: In any(summary(jeuNA[, j] == 0)) : coercing argument of type 'character' to logical

How can I solve this problem?
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "FactoMineR users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse factominer-use...@googlegroups.com.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msgid/factominer-users/4cce98a8-b229-46a4-916e-ff8844eb3eb5n%40googlegroups.com.

--
Francois Husson
Department Statistics & Computer science
AGROCAMPUS OUEST
65 rue de St-Brieuc - 35042 RENNES
Tel: +33 2 23 48 58 86
https://husson.github.io

hathaiphat vongthaiwan

unread,
Nov 17, 2020, 10:46:42 PM11/17/20
to FactoMineR users
I add 1 line for changing my data into dataframe as you suggested already before use estim_ncpFAMD() like this.

MyData <- as.data.frame(MyData) 
result <- estim_ncpFAMD(MyData) 

Afterthat, I use estim_ncpFAMD in next line in default, I got the result, but when I add method.cv (cross validation) is loo, It's not working and appear this error again.

result <- estim_ncpFAMD(MyData, method.cv = "loo")

Error in if (!any(summary(jeuNA[, j] == 0))) { : missing value where TRUE/FALSE needed In addition: Warning message: In any(summary(jeuNA[, j] == 0)) : coercing argument of type 'character' to logical
   
It means method.cv = loo is not suitable with missing data or NA in my data? 


I try to check class and type of myData using class(MyData) and typeof(MyData), it shows data.frame for class() and list for typeof()


How can I solve this problem? Which point is not correct?



Reply all
Reply to author
Forward
0 new messages