Re: [R] joining matrices, vectors, scalars in one object

2008-03-13 Thread Dimitris Rizopoulos
2:04 PM Subject: [R] joining matrices, vectors, scalars in one object Hi, I have: a <- matrix(c(0,1,0,1),nrow=2) b <- matrix(c(1,1,1,0,0,0),nrow=3) c <- 1 d <- c(1,0,1) And I would like to join them in an object 'thing' so that I can access a, b, c, or d through an index in

Re: [R] joining matrices, vectors, scalars in one object

2008-03-13 Thread Gabor Csardi
You want to do thing <- list()# empty thing for ( i in 1:100 ) { thing[[i]] <- ? } But where is ? coming from? If you can index it with an integer then it is exactly coming from the kind of object you want to create. Chicken-egg problem. No? G. On Thu, Mar 13, 2008 at 09:04:11A

[R] joining matrices, vectors, scalars in one object

2008-03-13 Thread Gonçalo Ferraz
Hi, I have: a <- matrix(c(0,1,0,1),nrow=2) b <- matrix(c(1,1,1,0,0,0),nrow=3) c <- 1 d <- c(1,0,1) And I would like to join them in an object 'thing' so that I can access a, b, c, or d through an index in a for loop. For example: thing[4] would return [1] 1 0 1 Note however, that I have m