[R] creating a matrix of "objects"

hadley wickham h.wickham at gmail.com
Wed Oct 26 15:19:18 CEST 2005


> Problem: I need to get a "matrix" of "datapoints".
>          Each datapoint has to contain tree attributes.

Have you tried:

m <- matrix(list(), nrbases, nrbases)

?  You would then index it using m[[i,j]].    A list is a basic
vector, so you can make a matrix with it, just as you can with a
vector of numbers.

Hadley




More information about the R-help mailing list