Re: [R] applying operations within() a matrix's environment

2014-07-04 Thread Steve Bellan
each step of cycle and keep only last value from your > cycle in first item in vectors v1-3? > > Because this is what your cycle does. > > Petr > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Steve Bellan > Sent: Friday, Ju

Re: [R] applying operations within() a matrix's environment

2014-07-04 Thread PIKAL Petr
} for(ii in 1:steps) { vars<-fff2(vars, row.active[,ii]) } Maybe sombody more capable than I can give you better answer. Regards Petr From: Steve Bellan [mailto:steve.bel...@gmail.com] Sent: Friday, July 04, 2014 1:06 PM To: PIKAL Petr Cc: r-help@r-project.org Subject: Re: [R] applying operatio

Re: [R] applying operations within() a matrix's environment

2014-07-04 Thread PIKAL Petr
...@r-project.org] On Behalf Of Steve Bellan Sent: Friday, July 04, 2014 12:53 AM To: r-help@r-project.org Subject: [R] applying operations within() a matrix's environment I am trying to optimize code for speed and readability for a fairly complex function inside an MCMC sampler. As of now I h

[R] applying operations within() a matrix's environment

2014-07-03 Thread Steve Bellan
I am trying to optimize code for speed and readability for a fairly complex function inside an MCMC sampler. As of now I have a bunch of variables inside a function that get iteratively reset inside a loop. Something like this: set.seed(1) K <- 10 v1 <- rnorm(K) v2 <- rnorm(K) v3 <- rnorm(K) ste