Can´t knit: Error in knn(..) : no missing values are allowed

Hi everyone!

When I try to knit my document the following error appears:

But I don´t seem to have any missing data and I can run perfectly the command manually:


 table(is.na(test))
  FALSE 
1122000 

table(is.na(train))
  FALSE 
2278000 

table(is.na(train_label))
FALSE 
 6700
 bin_test_pred_1 <- knn(train = train, test = test, cl =train_labelbin, k = 1,
                        prob = TRUE)

Does anyone know where the issue migth be?

Thanks in advance,
Jose

Not sure if this might be the reason for you but I have also faced a similar kind of issue.

Maybe you have manipulated your data in the environment but not in the same way in the script of the knit file. Double-check your codes how data is read and what steps are used to create objects on the knit file.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.