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

后端 未结 2 467
刺人心
刺人心 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:58

    The error is due to the presence of non-numeric variables in the data (numbers encoded as strings). You can convert them to numbers:

    mydata <- apply( mtcars, 2, as.numeric )
    d <- distfunc(mydata)
    

提交回复
热议问题