How to plot the decision boundary of kNN in R

knn
r
decision_boundary

#1

Hello,

I am doing a classification prob using caret package in R.Though I am getting confusion matrix

I want to plot a decision boundary:

I could not find any such function in the caret package itself.So is there a way to do this in R??