以下是我的数据,为什么会发生这种情况?
> classifier <- naiveBayes(mydata[1:15,1:5], mydata[16:20,1:5])
# Error in sort.list(y) : 'x' must be atomic for 'sort.list'
# Have you called 'sort' on a list?
数据:
Class_Name Left_Weight Left_Distance Right_Weight Right_Distance
1 B 1 1 1 1
2 R 1 1 1 2
3 R 1 1 1 3
4 R 1 1 1 4
5 R 1 1 1 5
6 R 1 1 2 1
7 R 1 1 2 2
8 R 1 1 2 3
9 R 1 1 2 4
10 R 1 1 2 5
11 R 1 1 3 1
12 R 1 1 3 2
13 R 1 1 3 3
14 R 1 1 3 4
15 R 1 1 3 5
16 R 1 1 4 1
17 R 1 1 4 2
18 R 1 1 4 3
19 R 1 1 4 4
20 R 1 1 4 5