Skip to content

Commit

Permalink
Loosened data requirements to accept 0 values as well
Browse files Browse the repository at this point in the history
  • Loading branch information
pwbogaart committed May 10, 2017
1 parent af14ca4 commit 9ed9887
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/R/trim_workhorse.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 9ed9887

Please sign in to comment.