[R] using cut on matrices

Tamas Papp
Sat, 12 Jul 2003 09:53:26 -0000

Dear list,

I'd like to use the function cut() on matrices, ie that when I apply
it to a matrix, it would return a matrix of the same dimensions
instead of a vector.

I wonder if there is a better (more elegant) solution than

matrix(cut(a, ...), ncol=ncol(a), nrow=nrow(a))

because I would like to use cut on both vectors and matrices and avoid
testing whether a is a matrix.

Thanks,

Tamas

--
Tam?s K. Papp
E-mail: tpapp at axelero.hu (preferred, especially for large messages)
        tpapp at westel900.net
Please try to send only (latin-2) plain text, not HTML or other garbage.