[R] creating a matrix of "objects"

From: Andreas Lehnert <andylehnert_at_gmx.de>
Date: Wed 26 Oct 2005 - 19:03:37 EST

Dear R,

I´m really new to R, so it could be that my question is one of those "read the manual" ones. But I did that and found nothing.

Problem: I need to get a "matrix" of "datapoints".

         Each datapoint has to contain tree attributes.

trials like:

make.LDmatrix <- function(nrbases){

b1 <- list(sum=NA, sqrsum=NA, hits=NA)
result <- list()

for(i in seq(1,nrbases)){

	for(j in seq(1,nrbases)){
		result[[i]][[j]] <- b1

}}

result
}

did not work because of a "out of bound" error.

It would be very kind if someone could help me with this.

Thanks, Andy

-- 
Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat,

______________________________________________
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 19:08:14 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:47 EST