雏菊出现“无效类型字符”错误

时间:2018-09-26 17:11:51

标签: cluster-analysis r-daisy

我有一个混合了数据类型(整数,字符和逻辑)的数据框,我正在尝试将其与雏菊群集在一起。

我正在使用:

gower_dist <- daisy(relchoice, metric = "gower")

并获得:

Error in daisy(relchoice, metric = "gower") : 
invalid type character for column numbers 3, 4, 5, 7, 8, 10, 13, 14, 15, 16, 
21, 29, 31, 32invalid type character for column numbers 3, 4, 5, 7, 8, 10, 
13, 14, 15, 16, 21, 29, 31, 32invalid type character for column numbers 3, 
4, 5, 7, 8, 10, 13, 14, 15, 16, 21, 29, 31, 32invalid type character for 
column numbers 3, 4, 5, 7, 8, 10, 13, 14, 15, 16, 21, 29, 31, 32invalid type 
character for column numbers 3, 4, 5, 7, 8, 10, 13, 14, 15, 16, 21, 29, 31, 
32invalid type character for column numbers 3, 4, 5, 7, 8, 10, 13, 14, 15, 
16, 21, 29, 31, 32invalid type character for column numbers 3, 4, 5, 7, 8, 
10, 13, 14, 15, 16, 21, 29, 31, 32invalid type character for column numbers 
3, 4, 5, 7, 8, 10, 13, 14, 15, 16, 21, 29, 31, 32invalid type character for 
column numbers 3, 4, 5, 7, 8, 10, 13, 14, 15, 16, 21, 29, 31, 32invalid type 
character for column numbers 3, 4, 5, 7, 8, 10, 13, 14, 15, 16, 21, 29, 31, 
32

在此方面会有所帮助。

1 个答案:

答案 0 :(得分:1)

我能够通过将分类字段转换为因子数据类型来解决此问题,例如:

server.rmi.ssl.disable=true