strange jags.parallel error / avoiding lazy evaluation in function call

前端 未结 1 1095
无人共我
无人共我 2020-12-21 04:01

I have a function call (to jags.parallel) that works when given a numerical argument like n.iter = 100 but fails when the argument uses a variable

1条回答
  •  太阳男子
    2020-12-21 04:30

    do.call() is a great go-to friend in situations like this because (from ?do.call):

    If 'quote' is 'FALSE', the default, then the arguments are evaluated (in the calling environment, not in 'envir').

    I confirmed that the following works, producing results that match your jagsfit.p through all digits displayed by the result object's print method:

    jagsfit.p2 <- do.call(jags.parallel, 
                          list(data=jags.data, inits=jags.inits, jags.params,
                               n.iter=n.iter, model.file=model.file))
    

    0 讨论(0)
提交回复
热议问题