Use the drop=FALSE argument to [.
drop=FALSE
[
m <- matrix(1:10,5,2)rownames(m) <- 1:5colnames(m) <- 1:2m[,1] # vectorm[,1,drop=FALSE] # matrix