Re: [R] for loop vectorization

2009-05-07 Thread miraceti
696 > http://www.burns-stat.com > (home of "The R Inferno" and "A Guide for the Unwilling S User") > > miraceti wrote: > >> Hi, I am still not familiar with vectorization. >> Could you help with making this for loop more efficient? >> The code is

Re: [R] for loop vectorization

2009-05-07 Thread miraceti
} else { transition[i,j] = "loss" } } } } transition On Thu, May 7, 2009 at 2:54 PM, miraceti wrote: > Hi, I am still not familiar with vectorization. > Could you help with making this for loop more efficient? > The c

[R] for loop vectorization

2009-05-07 Thread miraceti
Hi, I am still not familiar with vectorization. Could you help with making this for loop more efficient? The code is trying to make a Q matrix for a multidimensional state space with specific conditions. thanks Mira tmp = 0:(maxvals[1]) for(i in 2:nchars) { tmp <- outer(tmp, 0:(maxvals[i]), FU