Skip to content
Prev 30495 / 63421 Next

is.matrix

Daniel H?yer Iversen wrote:
that's a different story, because t() performs an implicit cast from
vector to matrix, so you have

t(vector) -> matrix
t(matrix) -> matrix
t(t(vector)) -> matrix

interestingly,

x = 1:2
dim(x) = 2

adds "matrix" to is(x), but it is still not is.matrix(x) (consistently
with the docs).
well, it might give 3 1 1, or 3 1 1 1, or ..., which all could be
considered logical.
i think dim(x) giving just 3 would be fine.

vQ