# removing the thunmbnail link column
youtube <- youtube[,-12]
# setting category_id as a factor variable
youtube$category_id <- as.factor(youtube$category_id)
# setting all 0 values for likes, dislikes and comments as NA
youtube[, 9:11][youtube[, 9:11] == 0] <- NA
# counting the missing values
sapply(youtube, function(x) sum(is.na(x)))
# removing the records where the likes and dislikes both are NA
youtube <- youtube %>%
filter(!is.na(likes) & !is.na(dislikes))
# imputing the missing comment_count values using knn
knnOut <- round(knnImputation(youtube[,8:11], k = 10))
для кода последнего knnOut: я получил неправильное сообщение Ошибка в rep (1, ncol (dist)): неверный аргумент times.