[R] subsetting matrix replacement oddities

Ross Boylan ross at biostat.ucsf.edu
Thu Sep 18 03:13:54 CEST 2003


On Wed, Sep 17, 2003 at 05:41:09PM -0700, Spencer Graves wrote:
> A subset of a data.frame is still a data.frame.  A data.frame is 
> actually a list with additional attributes.  As far as I know, your 
> solution, "as.matrix", is an appropriate tool to convert a data.frame to 
> a matrix.  Caution may be appropropriate, however, because if the 

That helps explain where the list assignment is coming from, but it
still seems very odd that assignment to a subset of a matrix should
change the class of the object, so that it is no longer a matrix.




More information about the R-help mailing list