Skip to content

Commit

Permalink
added a statement to check if likelihood is zonal logit and expected …
Browse files Browse the repository at this point in the history
…catch not equal to NULL, this generates an error instead of allowing users to create a model design that will fail at run
  • Loading branch information
Paul-Carvalho committed Jan 15, 2025
1 parent 4bf4768 commit 8825f71
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions R/make_model_design.R
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,16 @@ make_model_design <-
port <- pt$dataset # used in create_distance_matrix()
}, error = function(cond){
message("Port table not used.")
}
)
})

# check args ----

if (likelihood == "logit_c") {
# Expected catch input != NULL will generate errors when running models
if(likelihood == "logit_zonal" && !is.null(expectcatchmodels)){
stop("Expected catch input must be NULL for zonal logit models")
}

if(likelihood == "logit_c") {

column_check(dataset, c(catchID, vars1, priceCol, startloc))

Expand All @@ -301,7 +305,6 @@ make_model_design <-
column_check(dataset, c(catchID, vars1, vars2, priceCol, startloc))
}


ll_funs <- c("logit_c", "logit_zonal", "logit_correction", "epm_normal",
"epm_lognormal", "epm_weibull")

Expand Down

0 comments on commit 8825f71

Please sign in to comment.