> Reframe the problem. Rethink why you need to keep dimensions. I never ever 
> had to use drop.

The problem is that the type of the return value changes if you happen
to forget to use drop = FALSE, which can easily turn into a nightmare:

m <- matrix(1:20, ncol=4)
for (i in seq(3, 1, -1)) {
    print(class(m[1:i, ]))
}
[1] "matrix"
[1] "matrix"
[1] "integer"

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to