factoextra icon indicating copy to clipboard operation
factoextra copied to clipboard

Bug in `fviz_nbclust` function

Open Giuseppe1995 opened this issue 1 year ago • 2 comments

Hi, I was trying to run fviz_nbclust function on a NbClust-derived list (actually, I was following this tutorial) which returned this error:

Error in if (class(best_nc) == "numeric") print(best_nc) else if (class(best_nc) == : the condition has length > 1

I am trying to edit this function but it turned to be not easy at all. What I suggest is to edit class(best_nc) == "anyClass" with any(class(best_nc) == "anyClass"), because this would clearly solve the problem.

Have a nice day, Giusepe

Giuseppe1995 avatar Oct 02 '23 10:10 Giuseppe1995

I've had the same issue. I agree with the suggested edit.

ecknowles13 avatar Oct 25 '23 19:10 ecknowles13

Same here and the proposed Edition works perfectly. Cheers

LafontRapnouilTristan avatar Mar 21 '24 08:03 LafontRapnouilTristan