什么是从矩阵中获取行并作为矩阵的最短方法?
> x<-matrix(1:9,nrow=3,byrow=TRUE)
> x
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 4 5 6
[3,] 7 8 9
> x[1,]
[1] 1 2 3
> is.vector(x[1,])
[1] TRUE
我想要到达的地方
。 [,1] [,2] [,3]
[1,] 1 2 3