Skip to content

Commit

Permalink
getReproductionLevel() makes sense as long as R_max is known. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavdelius committed Nov 3, 2022
1 parent 572037f commit 15872f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/setBevertonHolt.R
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,8 @@ getRequiredRDD <- function(params) {
#' getReproductionLevel(params))
getReproductionLevel <- function(params) {
assert_that(is(params, "MizerParams"))
if (params@rates_funcs$RDD != "BevertonHoltRDD") {
stop("This function should only be used if the reproduction function ",
"is Beverton-Holt.")
if (!"R_max" %in% names(params@species_params)) {
stop("No `R_max` is included in the species parameters.")
}
getRDD(params) / params@species_params$R_max
}
Expand Down

0 comments on commit 15872f6

Please sign in to comment.