statistikat/VIM

kNN only works for data frames

drewhendrickson opened this issue · 1 comments

The documentation for kNN claims it works for data frames or matrices, but only is implemented for data frames.

It works for me, but maybe you are not happy that the output is then a data.table and not a matrix any more?

library(VIM)
data(sleep)
sm <- as.matrix(sleep)
str(sm)
s <- kNN(sm,imp_var = FALSE)
str(s)