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

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon Oct 18 16:15:48 CEST 2004


Uwe Ligges <ligges at 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 at biostat.ku.dk)             FAX: (+45) 35327907



More information about the R-devel mailing list