hi, from a rather complex data set (a huge matrix) i want to extract submatrices (of different no. of rows). i need to store those submatrices (resp. data.frames) in an array (at least something data structure i can address via an index to get the submatrices). unfortunately i have no idea how to accomplish that. thanks for any suggestions , greetinx jan -- Jan Malte Wiener Max-Planck-Institute for Biological Cybernetics Spemannstr. 38, 72076 Tuebingen, Germany Tel.: +49 7071 601 631 Email: jan.wiener at tuebingen.mpg.de -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Jan Malte Wiener wrote:> > hi, > from a rather complex data set (a huge matrix) i want to extract > submatrices (of different no. of rows). i need to store those > submatrices (resp. data.frames) in an array (at least something data > structure i can address via an index to get the submatrices). > unfortunately i have no idea how to accomplish that. > thanks for any suggestions ,You should use a list: X <- matrix(1:100, 10) Y <- matrix(1:25, 5) L <- list(X, Y) L[[2]] # get the second list element (Y) Uwe -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Put the matrices in a list? a <- matrix(1:4,2) b <- matrix(2:7,2) l <- list(a,b) l[[1]] [,1] [,2] [1,] 1 3 [2,] 2 4> l[[1]][1,2][1] 3 Kjetil Halvorsen Jan Malte Wiener wrote:> > hi, > from a rather complex data set (a huge matrix) i want to extract > submatrices (of different no. of rows). i need to store those > submatrices (resp. data.frames) in an array (at least something data > structure i can address via an index to get the submatrices). > unfortunately i have no idea how to accomplish that. > thanks for any suggestions , > greetinx jan > > -- > Jan Malte Wiener > Max-Planck-Institute for Biological Cybernetics > Spemannstr. 38, 72076 Tuebingen, Germany > Tel.: +49 7071 601 631 > Email: jan.wiener at tuebingen.mpg.de > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._