1

I usually find myself trying to make matrices be still matrices when I slice them.

I.e.,

xyz = matrix(1:8, 2, 4)
ncol(xyz[1,])
ncol(xyz[1,,drop=F])

Is there anyway to make that the slicing of xyz is always a matrix, such that the default is drop=F, for all slicing operations in my code?

Dnaiel
  • 7,362
  • 22
  • 61
  • 119

0 Answers0