# KNN with bagging in R

How to implement bagging with KNN using R in order to reduce the variability?

This is the R code that I use for KNN

knn.pred <- knn(training, testing, target_variable)


I am not sure that this is what you are asking for but the package FNN implements the bagged nn in its ownn function.