aboutsummaryrefslogtreecommitdiff
path: root/R/boot.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/boot.R')
-rw-r--r--R/boot.R3
1 files changed, 3 insertions, 0 deletions
diff --git a/R/boot.R b/R/boot.R
index 3da4fd0..67f9a42 100644
--- a/R/boot.R
+++ b/R/boot.R
@@ -84,6 +84,9 @@ setMethod("parboot", "unmarkedFit", function(object, statistic=SSE, nsim=10,
if(length(t0) == 1) t.star <- matrix(t.star, ncol=1)
failed <- apply(t.star, 1, function(x) any(is.na(x)))
+ if(all(failed)){
+ stop("Model fitting failed in all sims.", call.=FALSE)
+ }
if(sum(failed) > 0){
warning(paste0("Model fitting failed in ",sum(failed), " sims."), call.=FALSE)
t.star <- t.star[!failed,,drop=FALSE]