-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dudi.mix fails when ordered variable only has two levels #10
Comments
Not entirely related to the issue, but I also noted that dudi.mix is using When this is the case, nlevels() causes computations to fail (in dudi.mix) with the error:
So I suggest replacing Let me know if you'd like me to do a pull request :) Cheers, |
Hi Ceres, Thanks for the report. I just correct the bug for your first point. Considering the second point, we consider that data should be cleaned before the analysis (for instance by using We could do this checking in ade4 in the future. But this requires to do it for all functions that takes factors as arguments (I open issue #11) for this point. Cheers ! |
Thanks for your prompt answer and for correcting the said bug :) Cheers, |
Yes ! Thanks Ceres. |
Hi everyone,
I'm trying to run dudi.mix on a data set that has a mix of categorical (factor and ordered variables) and continuous variables and I've noticed that it can't compute when an ordered variable only has two levels.
I believe the problem is in the internal
floc
function, whereapply(w, 2, sum)
fails because there is only one column in this particular case (and thusw
is no longer a matrix, but a vector).I first thought that perhaps we should always have more than two levels (if that is the case, would it possible to add some checks to dudi.mix?). But then I noticed that prior to the
dudi
objectX
being created, the function does deal with the case of only having two levels (seeif (deg.poly == 1) cha <- names(df)
)I'm not sure what the best way of dealing with this is, so I thought it best to post an issue here. Here's a reproducible example:
Any help is much appreciated!
Ceres Barros
The text was updated successfully, but these errors were encountered: