How to perform clustering without removing rows where NA is present in R

后端 未结 2 486
刺人心
刺人心 2020-12-29 00:03

I have a data which contain some NA value in their elements. What I want to do is to perform clustering without removing rows where the NA is present.

2条回答
  •  难免孤独
    2020-12-29 00:55

    Using as.numeric may help in this case, but I do think that the original question points to a bug in the daisy function. Specifically, it has the following code:

        if (any(ina <- is.na(type3))) 
        stop(gettextf("invalid type %s for column numbers %s", 
            type2[ina], pColl(which(is.na))))
    

    The intended error message is not printed, because which(is.na) is wrong. It should be which(ina).

    I guess I should find out where / how to submit this bug now.

提交回复
热议问题