diff --git a/R/check.R b/R/check.R index 1913b41..41bcfc1 100644 --- a/R/check.R +++ b/R/check.R @@ -209,7 +209,9 @@ setMethod( if (!isTRUE(all.equal(names(b), a@names))) stop("Names of the vector must match the names of the transient states in the P matrix", call. = FALSE) - if (any(!is.finite(b)) || any(b < 0)) stop("Input must only contain positive numeric values", call. = FALSE) + if (any(!is.finite(b)) || any(b < 0) || any(is.na(b))) stop("Input must only contain positive numeric values", call. = FALSE) if (length(b) != length(a@data@t_abs)) stop("Input length does not match number of transient states", call. = FALSE) + + if (sum(b) <= 0) stop("Input must contain at least one positive numeric value", call. = FALSE) })