Re: [Rd] is.vector(as.vector(x)) is FALSE

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Tue 19 Oct 2004 - 00:15:48 EST

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

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue Oct 19 00:41:20 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:22 EST