I got the following error messages during the KNN imputation:
#KNN imputation
library(VIM)
?knn()
KNNImputed <- kNN (data1, variable = c("var_1"), k = 20)
> In `[<-.data.table`(`*tmp*`, indexNA2s[, variable[j]], variable[j], :
> Coerced 'double' RHS to 'integer' to match the column's type; may have truncated precision. Either change the target column ['var_1'] to 'double' first (by creating a new 'double' vector length 787 (nrows of entire table) and assign that; i.e. 'replace' column), or coerce RHS to 'integer' (e.g. 1L, NA_[real|integer]_, as.*, etc) to make your intent clear and for speed. Or, set the column type correctly up front when you create the table and stick to it, please.
Could you please turn this into a self-contained reprex (short for reproducible example)? It will help us help you if we can be sure we're all working with/looking at the same stuff.
If you run into problems with access to your clipboard, you can specify an outfile for the reprex, and then copy and paste the contents into the forum.