Re: [R] for loop optimization help

2012-08-27 Thread Jinsong Zhao
On 2012-08-27 22:25, David Winsemius wrote: On Aug 27, 2012, at 1:53 AM, Jinsong Zhao wrote: On 2012-08-27 9:35, David Winsemius wrote: On Aug 26, 2012, at 5:06 PM, Jinsong Zhao wrote: Hi there, In my code, there is a for loop like the following: pmatrix <- matrix(NA, nrow = 99, ncol =

Re: [R] for loop optimization help

2012-08-27 Thread David Winsemius
On Aug 27, 2012, at 1:53 AM, Jinsong Zhao wrote: On 2012-08-27 9:35, David Winsemius wrote: On Aug 26, 2012, at 5:06 PM, Jinsong Zhao wrote: Hi there, In my code, there is a for loop like the following: pmatrix <- matrix(NA, nrow = 99, ncol = 1) qmatrix <- matrix(NA, nrow = 99, ncol

Re: [R] for loop optimization help

2012-08-27 Thread Jinsong Zhao
On 2012-08-27 9:35, David Winsemius wrote: On Aug 26, 2012, at 5:06 PM, Jinsong Zhao wrote: Hi there, In my code, there is a for loop like the following: pmatrix <- matrix(NA, nrow = 99, ncol = 1) qmatrix <- matrix(NA, nrow = 99, ncol = 3) paf <- seq(0.01, 0.99, 0.01) for (i in 1

Re: [R] for loop optimization help

2012-08-26 Thread David Winsemius
On Aug 26, 2012, at 5:06 PM, Jinsong Zhao wrote: Hi there, In my code, there is a for loop like the following: pmatrix <- matrix(NA, nrow = 99, ncol = 1) qmatrix <- matrix(NA, nrow = 99, ncol = 3) paf <- seq(0.01, 0.99, 0.01) for (i in 1:1) { p.r.1 <- rnorm(1000, 1, 0.5)