R-alpha: is.vector(matrix(2,2,2)) gives TRUE // c,cbind,rbind with NAMES...

Martin Maechler (maechler@stat.math.ethz.ch)
Thu, 16 May 1996 18:31:45 +0200


Date: Thu, 16 May 1996 18:31:45 +0200
Message-Id: <199605161631.SAA12127@ingrid.ethz.ch>
From: Martin Maechler <maechler@stat.math.ethz.ch>
To: R-testers@stat.math.ethz.ch
Subject: R-alpha: is.vector(matrix(2,2,2)) gives TRUE //  c,cbind,rbind with NAMES...

It is questionable if this is okay or not.

The problem is that  S returns  F  for matrices
and, since  as.vector coerces matrices to (1-dim) vectors,
is.vector probably only should return TRUE for those.

Note: There's a long-standing bug [imho] in S(-plus)
	[which maybe will remain for compatibility reasons, I don't know..]
      namely,

  > is.vector(c(a=1:3))
  [1] F

--
This brings up another incompatibility which rather is a missing feature in
R: 
	c(a= runif(4))  produces a  NAMED vector in S (names 'a1'..'a4').
and
	cbind(v1= 1, v2 = 1:10)  gives a matrix with COL.NAMES
both of which don't work yet in R..
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-