Re: [R] place values into a matrix efficiently?

2011-11-20 Thread Carl Witthoft
Excellent. That's what I was looking for. Thanks, Rolf. Carl On 11/19/11 11:16 PM, Rolf Turner wrote: On 20/11/11 16:27, Carl Witthoft wrote: This question attacked me as I was thinking about matrix value updates. I probably will never need to do this, but wanted to ask if there are efficien

Re: [R] place values into a matrix efficiently?

2011-11-19 Thread Rolf Turner
On 20/11/11 16:27, Carl Witthoft wrote: This question attacked me as I was thinking about matrix value updates. I probably will never need to do this, but wanted to ask if there are efficient methods to perform the for-loop in the following sequence. %xymat<-matrix(rep(0,100) nr=10,nc=10) #

[R] place values into a matrix efficiently?

2011-11-19 Thread Carl Witthoft
This question attacked me as I was thinking about matrix value updates. I probably will never need to do this, but wanted to ask if there are efficient methods to perform the for-loop in the following sequence. %xymat<-matrix(rep(0,100) nr=10,nc=10) # empty matrix %x<-1:10 %y<-sample.int(10,1