Error in knn(train = trainData1, test = testData1, cl = p_tl, k = 3, prob = TRUE) :
NA/NaN/Inf in foreign function call (arg 6)
In addition: Warning messages:
1: In knn(train = trainData1, test = testData1, cl = p_tl, k = 3, prob = TRUE) :
NAs introduced by coercion
2: In knn(train = trainData1, test = testData1, cl = p_tl, k = 3, prob = TRUE) :
NAs introduced by coercion
We don't really have enough info to help you out. Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.