有问题的代码如下
- res=as.data.frame(matrix(1:81,9,9))
- res
- for (i in 2:10) {
- for (j in 2:10) {
- somb <- som(cnorm, xdim=i, ydim=j, topol="hexa", neigh="gaussian")
- res[i-1,j-1]=somb$qerror
- }
- }
- Error in som(cnorm, xdim = i, ydim = j, topol = "hexa", neigh = "gaussian") :
- REAL() can only be applied to a 'numeric', not a 'integer'
而在外面的时候
- soma <- som(cnorm, xdim=2, ydim=2, topol="hexa", neigh="gaussian")
哪位大神能告诉一下这是什么情况,谢谢


雷达卡


京公网安备 11010802022788号







