[Rd] is.vector(...) <-> is(..., "vector")

From: <Matthias.Kohl_at_uni-bayreuth.de>
Date: Thu 30 Dec 2004 - 21:09:50 EST


Hello,

Is it intended that is.vector(...) and is(..., "vector") do not always give identical results?

is.vector() works as documented ('is.vector' returns 'FALSE' if 'x' has any attributes except names.) Thus,

A <- array(1:2, 1:2)
M <- diag(2)

is.vector(M) # FALSE, as documented
# and

is.vector(A) # FALSE, as documented

# however

is(M, "vector") # TRUE
is(A, "vector") # TRUE

# which is also correct, since

extends("matrix", "vector")
extends("array", "vector")

I'm working with R Version 2.0.1 Patched (2004-12-09) on Windows 2000.

Thanks, for any comments!
Matthias



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Dec 30 20:15:41 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:02:21 EST