diff options
author | mikemeredith <mmeredith@wcs.org> | 2021-02-03 17:12:48 +0800 |
---|---|---|
committer | mikemeredith <mmeredith@wcs.org> | 2021-02-03 17:12:48 +0800 |
commit | a782efdbbd41fa3e7e4a5656de8d1c79725d651d (patch) | |
tree | a9ed33e13188a04332be390dd7c09ec0240f7034 | |
parent | a8d827a121aa7fb7e761df8aaca4a2052a1fece1 (diff) |
Fix bug in update.jagsUI
When processing output and running out of memory ("cannot allocate vector..." error) should fall back to class jagsUIbasic, but code to catch the NULL output from 'process.output' not there. Now added.
-rw-r--r-- | DESCRIPTION | 4 | ||||
-rw-r--r-- | R/update.R | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index 3a84308..f3b4c6c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: jagsUI -Version: 1.5.1.9100 -Date: 2020-10-07 +Version: 1.5.1.9101 +Date: 2021-01-31 Title: A Wrapper Around 'rjags' to Streamline 'JAGS' Analyses Author: Ken Kellner <contact@kenkellner.com> Maintainer: Ken Kellner <contact@kenkellner.com> @@ -53,7 +53,15 @@ update.jagsUI <- function(object, parameters.to.save=NULL, n.adapt=NULL, n.iter, #Run process output output <- process.output(samples,DIC=DIC,codaOnly,verbose=verbose) - + if(is.null(output)){ + output <- list() + output$samples <- samples + output$model <- m + output$n.cores <- object$mcmc.info$n.cores + class(output) <- 'jagsUIbasic' + return(output) + } + #Summary output$summary <- summary.matrix(output,samples,object$mcmc.info$n.chains,codaOnly) |