0

Without going to the source code and pulling the relevant line of code, can someone explain how this is not an error?

a <- matrix(rnorm(50), nrow= 10, ncol= 5)
dim(apply(a, 2, function(j) return(j)))
# [1] 10  5
dim(apply(a, 1, function(j) return(j)))
# [1]  5 10

Why the unrequested transpose?

Alex W
  • 4,619
  • 4
  • 28
  • 55
  • thanks--didn't search for a duplicate. Another issue of `[,,drop= TRUE]` causing problems. One reason that I *hate* `drop`... Do I delete or does it get closed automatically? – Alex W Jan 29 '16 at 01:48
  • Not 100% sure, but I think you also can accept the duplicate. It is up to you I guess. –  Jan 29 '16 at 01:49

0 Answers0