Prevent drop dimension attribute by drop …

Prevent drop dimension attribute by drop = FALSE.

test.matrix <- matrix(1:15, nc=5)
> test.matrix[1, ]
[1]  1  4  7 10 13
> test.matrix[1, , drop=FALSE]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    4    7   10   13

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *