将 klaR kmodes 算法应用于以下数据集
> summary(raw)
CREDIT_LIMIT CP gender IE_CHILD_NB IE_TOT_DEP_NB TOTAL_INCOME IE_HOUSE_CHARGE maritial
>2000 : 612 11500 : 145 MM: 5435 0:7432 0:1446 >2000 :3524 >2000 : 2 D : 1195
0-500 :10458 11100 : 90 MR:12983 1:4119 1:3748 0-500 :1503 0-500 :17146 M :10507
1000-1500: 2912 08830 : 71 2:5787 2:3386 1000-1500:6649 1000-1500: 44 MISS: 1446
1500-2000: 2254 11406 : 68 3: 947 3:3740 1500-2000:4116 1500-2000: 5 Ot : 1043
500-1000 : 2182 35018 : 66 4: 133 4:6098 500-1000 :2626 500-1000 : 1221 S : 4227
11510 : 62
(Other):17916
new_age job_age
>70 : 295 0-20 :14627
0-30 : 815 20-30: 1986
30-40:4867 30-40: 612
40-50:7293 40-50: 124
50-60:3883 50-60: 1069
60-70:1265
我收到以下错误
> cluster.results <-kmodes(data=raw, modes=4, iter.max = 10, weighted=FALSE )
Error: Column index must be at most 5 if positive, not 6
知道错误是什么吗?
Bests
任何搜索该错误的人的部分答案:错误意味着某个对象被调用以返回其范围之外的元素,例如比现有的列更多,例如:
> aa <- tibble(bb = c(1,2))
> aa
# A tibble: 2 x 1
bb
<dbl>
1 1.00
2 2.00
> aa[,2]
Error: Column index must be at most 1 if positive, not 2
在这种情况下,我不确定错误的来源,列表和数据帧不会发生这种情况(dfs returnundefined columns selected
,并列出返回NULL
),而且我不使用那个包。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)