R I´;我得到一个错误';列车';和';类别';具有不同的长度';

R I´;我得到一个错误';列车';和';类别';具有不同的长度';,r,R,“我的数据如下所示” talk_sec wait_sec pause_sec length_sec in_second_count hora estado ventas 17779011日航 126771009日航 1304110010日航 1940294012日航1 请勿在评论中发布数据。阅读什么是wisc\u培训\u标签和wisc\u培训?什么是length(wisc\U training\u标签)和nrow(wisc\u training)?很抱歉,我在另一个数据中犯了错误,应该是b\U

“我的数据如下所示”

talk_sec wait_sec pause_sec length_sec in_second_count hora estado ventas
17779011日航
126771009日航
1304110010日航
1940294012日航1

请勿在评论中发布数据。阅读什么是
wisc\u培训\u标签
wisc\u培训
?什么是
length(wisc\U training\u标签)
nrow(wisc\u training)
?很抱歉,我在另一个数据中犯了错误,应该是b\U test\u,请勿在评论中发布数据。阅读什么是
wisc\u培训\u标签
wisc\u培训
?什么是
长度(wisc\U培训\u标签)
nrow(wisc\U培训)
?很抱歉,我从另一个数据中犯了错误,应该是b\U测试
enter code here
library(class)
library(caret)
  b_data <- b[,-1]
  b_data <- mutate(b_data,
  dia = fct_recode(b$ventas))
  b$ventas <- as.factor(b$ventas)
  b$estado <- as.factor(b$estado)
  round(prop.table(table(b_data$dia)) * 100, 1)
  normalize <- function(x){
  return ((x - min(x))/(max(x) - min(x)))
  }
  b_data_n <- as.data.frame(lapply(b_data[1:5], normalize))
  nrow(b)
  [1] 887622
  b_training <- b_data_n[1:443811,]
  b_test <- b_data_n[443812:887622,]
  b_training_labels <- b_data[1:443811,1]
  b_test_labels <- b_data[443812:887622,1]
  b_test_predicted <- knn(b_training, b_test, cl = b_training_labels, k = 943) 
    dim(b_test)
[1] 443811      5

 dim(b_training)
[enter image description here][1][1] 443811      5

length(b_training_labels)
[1] 1
 talk_sec wait_sec pause_sec length_in_sec called_count hora estado ventas
 <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <fct> <fct>
 1 777 9 0 0 0 11 JAL 
1 2 677 1 0 0 0 9 JAL 
1 3 0 4 11 0 0 10 JAL 
1 4 0 29 4 0 0 12 JAL 1