Closed msmith01 closed 4 years ago
knn.impute
works on numerical matrices, not on dataframes. The documentation is wrong, sorry, I will fix it as soon as possible. The workaround is
data <- iris[, 1:4]
data <- prodNA(data, noNA = 0.2)
knn.impute(as.matrix(data), k = 10, cat.var = 1:ncol(data),
to.impute = 1:nrow(data), using = 1:nrow(data))
Thanks for pointing this out.
Returns:
Also;
Gives the same error.
Source: