I tried using the KNN function from the VIM package to impute for the NA values in one of the columns in my dataframe. The column which has the NA values has some categorical variables in it namely: normal, spam and undecided. The function basically worked but I am not able to interpret the warning message that it is producing.
Here is the code:
#KNN impute
final1<-kNN(final,variable="spam")
This is the warning message that it is producing:
Warning messages:
1: In gowerD(don_dist_var, imp_dist_var, weights = weightsx, numericalX, :
NAs introduced by coercion
2: In gowerD(don_dist_var, imp_dist_var, weights = weightsx, numericalX, :
NAs introduced by coercion
I thought it had freshly produced some NA's and went ahead to check it using this code:
> sapply(final1, function(x) sum(is.na(x)))
There are no NA's in the dataframe, which means the KNN imputation has done it's job. But my worry is why is it still producing that error? And how should I be dealing with it?
Any suggestions would be highly appreciated. Thanks in advance.