ing to get this to work with the
%do% operator first, and then try %dopar%.
- Steve Weston
REvolution Computing
> From: dunno87
> Date: Wed, Oct 7, 2009 at 5:56 PM
> Subject: [R] foreach loop - rejection method
> To: r-help@r-project.org
>
>
>
> Hi Everybody,
>
> Th
First, you should define your function as :
test <- function(cand2,phi,lambda,
whatever-arguments-you-want-to-use-further){... insert code here ...}
All variables you use inside a function only exist within that
function. Your parameters/arguments is the interface between the
function and the outs
Your function is referencing 'cand2' but where is it defined? There
are other objects referenced in the function that do not appear to be
passed in as parameters. Are they defined globally? What do you
think the following statement in your function is doing:
cand2[l-1]<-rinvgamma(1,phi,lambda[
Hi Everybody,
Thanks in advance for your help.
This is my first time using the foreach statement and I cant get it to work
properly so here is what i have
test<-function(){
repeat {
cand2[l-1]<-rinvgamma(1,phi,lambda[l-1])
q2<-dinvgamma(cand2[l-1],phi,lambda[l-1])
p2<-cand2[l-1]^-1.5*exp(-y[l]^2
4 matches
Mail list logo