Let X be an N by D matrix. Selecting a submatrix of size n by d returns a matrix of those dimensions unl
X
N
D
n
d
If you don't want to simplify matrix subsets to vectors just tell [ not to drop dimensions:
[
> dim(X[1:2,1, drop=FALSE]) [1] 2 1 > dim(X[1,1:2, drop=FALSE]) [1] 1 2
See ?"[" for details.
?"["