Skip to content

Commit de75fe1

Browse files
author
kerim aydin
committed
catch -inifinte/missing values in x- error and give more informative error.
1 parent 4c064fb commit de75fe1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

R/ecopath.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ rpath <- function(Rpath.params, eco.name = NA, eco.area = 1) {
142142
A <- A - QBDCa
143143
#Switch flag back
144144
#living[BEE == 1, noB := 0]
145+
146+
# Check for any missing info that will prevent solving
147+
if (any(is.na(A))){
148+
stop("Model is missing parameters - can't be balanced. Use check.rpath.params() to diagnose.")
149+
}
145150

146151
# Generalized inverse does the actual solving
147152
#Invert A and multiple by b to get x (unknowns)

0 commit comments

Comments
 (0)