我有一个混合数据类型(整数、字符和逻辑)的数据框,我试图用菊花进行聚类。
我在用着:
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
希望对此有所帮助。