Hi dear users,
I try to split a matrix into a few matrices, for example, suppose that I have 1000X4 matrix from mvrnorm(1000,m,c) with m<-matrix(c(0,0,0,2),4,1) and c<-matrix(c(1.0,0.2,-0.5,0.3,0.2,1,0.2,-0.5,-0.5,0.2,1,0.2,0.3,-0.5,0.2,1),4,4,byrow=T) How to split the matrix into a. 2 matrices which the first one consists of the first 500 rows, and the second one consist of the last 500 rows b. split the matrix equally and sequentially (according to the order of the rows) into say 10 matrices with 100 x 4 dimension c. how to do (b) randomly, not following the order of the rows, but without any overlapping. So all the 10 matrices will consists of different values from the original matrix. Your help is very much appreciated....thank you ayu -- View this message in context: http://n4.nabble.com/How-to-split-a-matrix-into-a-few-matrices-tp1311535p1311535.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.