Skip to content

Commit

Permalink
Add more conditions to vector in check()
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmarx committed Jul 4, 2024
1 parent 604e375 commit 6abb099
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

0 comments on commit 6abb099

Please sign in to comment.