> x1<-array(1:24,dim=c(2,3.4))
> x1
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
> x1
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
大佬,你的代码里dim(2,3,4)打成了dim(2,3.4)
array usage里:
dim
the dim attribute for the array to be created, that is an integer vector of length one or more giving the maximal indices in each dimension.
所以相当于as.integer(3.4) equals 3
自然就是2行3列啦