How do I implement knn using errorest in the ipred package in R

knn
r

#1

Hello,

In the above image I am trying to compare various classification algorithms on a dataset.
I have implemented ctree,naive bayes,svm and random forest,knn.
But I am having difficulty in trying to implment knn here.I am not understanding how to resolve this error.
Can someone please help me with this??
These are the libraries that are loaded:
library(MASS)
library(randomForest)
library(ipred)
library(e1071)
library(party)