[R] creating a matrix of "objects"

Andreas Lehnert andylehnert at gmx.de
Wed Oct 26 11:03:37 CEST 2005


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,




More information about the R-help mailing list