[R] matrix from list

Olivier Lefevre lefevrol at yahoo.com
Sat Apr 26 01:31:16 CEST 2008

Greg Snow wrote:
> The '[[' only returns a single element from a data structure

I know but that is precisely what I find arbitrary.

Anyway you are right that it would still return the kind of object, only 
subsetted, which is not I want. As someone kindly pointed out to me 
offline, besides the unlist trick posted before, you can also achieve the 
desired result with

   m <- as.matrix(l)
   dimnames(m) <- NULL

-- O.L.

More information about the R-help mailing list