R programming language resources › Forums › Data manipulation › Matrix and boucle.
- This topic has 0 replies, 1 voice, and was last updated 13 years, 3 months ago by
Glen360.
- AuthorPosts
- January 24, 2012 at 4:25 pm #459
Glen360
MemberHello,
I made a boucle that put data inside N matrix. So for N=45, I have M1:M45.
Then I want to make a sn.em on each columns of each matrix. I don’t know how to call a i matrix (matrix(i) / matrix[i]) for i in 1:45.
Here is the code to make M1:M45
numberOfConfig8min <- length(numberOfCloseNonMatchConfig8min) counterCloseNonMatchConfig <- 0 M<-matrix( 0, nrow(closestNonMatchTrianglesVariablesOrdered8min_aspectRatio$formVector[,]), ncol(closestNonMatchTrianglesVariablesOrdered8min_aspectRatio$formVector[,])) for (i in 1: numberOfConfig8min){ assign(paste("M",i,sep=""), closestNonMatchTrianglesVariablesOrdered8min_aspectRatio$formVector[(counterCloseNonMatchConfig+1):(counterCloseNonMatchConfig+ min(250,numberOfCloseNonMatchConfig8min[i])),]) counterCloseNonMatchConfig <-counterCloseNonMatchConfig + min(250,numberOfCloseNonMatchConfig8min[i]) } So 45 matrix of 8 columns. Then I want a sn.em on each columns of each matrix. Thanks you very much if you can help me. Would be really appreciate. Best. Glen
- AuthorPosts
- You must be logged in to reply to this topic.