From pinard at iro.umontreal.ca  Wed Apr 19 20:43:27 2006
From: pinard at iro.umontreal.ca (=?iso-8859-1?Q?Fran=E7ois?= Pinard)
Date: Wed, 19 Apr 2006 14:43:27 -0400
Subject: [Rd] `as.vector' documentation
Message-ID: <20060419184327.GA13035@phenix.sram.qc.ca>

Hi, people.  This is R 2.2.1 under i686 Linux:


> attributes(as.vector(data.frame(a=1)))
$names
[1] "a"

$row.names
[1] "1"

$class
[1] "data.frame"


?attribute says:

     'as.vector', a generic, attempts to coerce its argument into a
     vector of mode 'mode' (the default is to coerce to whichever mode
     is most convenient).  The attributes of 'x' are removed.


The last sentence could be amended to say that the attributes of 'x' are 
removed "if the coercion succeeds".  As currently written, it may be 
interpreted as meaning that the attributes are removed unconditionally.


-- 
Fran?ois Pinard   http://pinard.progiciels-bpi.ca



[Rd] `as.vector' documentation
=?iso-8859-1?Q?Fran=E7ois?= Pinard