From p.dalgaard at biostat.ku.dk  Mon Oct 18 16:15:48 2004
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Mon Oct 18 16:19:04 2004
Subject: [Rd] is.vector(as.vector(x)) is FALSE
In-Reply-To: <4173A26F.7040806@statistik.uni-dortmund.de>
References: <loom.20041017T034921-592@post.gmane.org>
	<20041018123830.784a4608.Achim.Zeileis@wu-wien.ac.at>
	<4173A26F.7040806@statistik.uni-dortmund.de>
Message-ID: <x23c0cjenf.fsf@biostat.ku.dk>

Uwe Ligges <ligges@statistik.uni-dortmund.de> writes:

> ... I think I'd rather expect that
> 
>    as.vector(x1mat, mode = "list")
> 
> also removes the dim attributes.

Just checked, Splus seems to satisfy is.vector(as.vector(x)) for list
matrices and data frames. The R docs have

     '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.

so I think there is a case for deeming the current behaviour to be a bug...

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] is.vector(as.vector(x)) is FALSE
Peter Dalgaard