From 9ed9887970e3a5af2f3100fe47c7bc0e848a2b39 Mon Sep 17 00:00:00 2001 From: pwbogaart Date: Wed, 10 May 2017 12:24:35 +0200 Subject: [PATCH] Loosened data requirements to accept 0 values as well --- pkg/R/trim_workhorse.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/R/trim_workhorse.R b/pkg/R/trim_workhorse.R index f950a54..ef0a567 100644 --- a/pkg/R/trim_workhorse.R +++ b/pkg/R/trim_workhorse.R @@ -489,7 +489,7 @@ trim_workhorse <- function(count, site.id, year, month=NULL, covars=data.frame() # Now that we know much parameters are requested, check if we do have enough observations. # For this, we ignore the `0' observations nalpha <- length(alpha) - if (sum(npos) < (nalpha+nbeta)) { + if (sum(nobs) < (nalpha+nbeta)) { msg <- sprintf("Not enough positive observations (%d) to specify %d parameters (%d alpha + %d beta)", sum(npos), nalpha+nbeta, nalpha, nbeta) if (soft) return(list(error=msg)) else stop(msg, call.=FALSE) }