all.equal() 对这些数据给出“无效的参数类型”错误。任何想法?
>matrix1
1 2 3 4 5
1 0 0 0.0 0 0.0
2 1 0 0.0 0 0.0
3 0 1 0.0 0 0.0
4 0 0 0.5 0 0.5
5 0 0 1.0 0 0.0
>rowSums(matrix1)
1 2 3 4 5
0 1 1 1 1
> !all.equal(as.vector(rowSums(matrix1)), as.vector(rep(1, nrow(matrix1))), check.attributes=FALSE)
Error in !all.equal(as.vector(rowSums(matrix1)), as.vector(rep(1, :
invalid argument type