运行到cos_dist = cosineDist(vec[rr],vec[rr])报错:
Warning messages:
1: In matrix(nextup, ncol = ncol(x)) :
data length [31] is not a sub-multiple or multiple of the number of columns [100]
2: In matrix(nextup, ncol = ncol(x)) :
data length [31] is not a sub-multiple or multiple of the number of columns [100]
解决:加两个逗号cos_dist = cosineDist(vec[rr,],vec[rr,])运行可以得到正确结果。