Re: [R] creating a matrix of "objects"

From: hadley wickham <h.wickham_at_gmail.com>
Date: Wed 26 Oct 2005 - 23:19:18 EST

> 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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Oct 26 23:48:15 2005

This archive was generated by hypermail 2.1.8 : Thu 27 Oct 2005 - 00:39:20 EST