[R] Write vector/matrix in a loop

kokavolchkov kokavolchkov at gmail.com
Tue Aug 16 19:31:18 CEST 2011


Hello!

I'm trying to *save values* (*row and col*) in two matrices(1,m) or vectors.
I have a loop, where a get these values:

for(i in 144){
	for(j in 73){
		if(B4[i,j]==1){ # B4 is a matrix(73, 144)
			row <- B4[i-(i-1),j] 
			col <- B4[i,j-(j-1)] 
		}
	}
}

*How to save row and col?*

Thank you!

--
View this message in context: http://r.789695.n4.nabble.com/Write-vector-matrix-in-a-loop-tp3747862p3747862.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list