title: Error in knn(trainDataX, validationDataX, trainingType, k = 3) : 'train' and 'class' have different lengths
body: <p>i am learning how to use R program language. Now i am learning the pca technique, the question was to train a model with the knn technique and to find out which is the accuracy value for the training model here is my code, actually i am not preety sure if what i've made till now is correct, anyway.</p>
  
  <p><a href="https://i.stack.imgur.com/erFXo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/erFXo.png" alt="enter image description here"></a></p>
  
  <p>sorry for the .png for the code i just couldn't give to the code the format i wanted. Thanks for your time!</p>