Skip to content

Commit

Permalink
setExtEncounter() no longer resets the external encounter rate to z…
Browse files Browse the repository at this point in the history
…ero when called without the `ext_encounter` argument.
  • Loading branch information
gustavdelius committed Aug 2, 2024
1 parent 7a9220a commit 5fb6f2a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Authors@R: c(person("Gustav", "Delius", email="gustav.delius@york.ac.uk",
comment = c(ORCID = "0000-0002-8478-3430")),
person("Richard", "Southwell", email="richard.southwell@york.ac.uk",
role=c("ctb", "cph")))
Version: 2.5.1.9001
Version: 2.5.1.9002
License: GPL-3
Imports:
assertthat,
Expand Down Expand Up @@ -103,7 +103,7 @@ Collate:
'matchGrowth.R'
'steadySingleSpecies.R'
'defaults_edition.R'
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
LazyData: true
Expand Down
7 changes: 5 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Updating default values for plotBiomassObservedVsModel
# Development version

The function `plotBiomassObservedVsModel` now plots the ratio of modelled
- `setExtEncounter()` no longer resets the external encounter rate to zero when
called without the `ext_encounter` argument.

- The function `plotBiomassObservedVsModel()` now plots the ratio of modelled
to observed biomass as default (`ratio = T`), as this is more useful visually to
see how far off modelled biomass is from observed biomass.

Expand Down
1 change: 1 addition & 0 deletions R/newMultispeciesParams.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ newMultispeciesParams <- function(
#' \item [setMaxIntakeRate()]
#' \item [setMetabolicRate()]
#' \item [setExtMort()]
#' \item [setExtEncounter()]
#' \item [setReproduction()]
#' \item [setFishing()]
#' \item [setResource()]
Expand Down
4 changes: 2 additions & 2 deletions R/setExtEncounter.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#'
#' @param params MizerParams
#' @param ext_encounter Optional. An array (species x size) holding the external
#' encounter rate. If not supplied, a default of 0 is used.
#' encounter rate. If not supplied, the external encounter rate is left
#' unchanged. Initially is is set to 0.
#' @param ... Unused
#'
#' @return `setExtEncounter()`: A MizerParams object with updated external encounter
Expand All @@ -36,7 +37,6 @@ setExtEncounter <- function(params, ext_encounter = NULL, ...) {

if (is.null(ext_encounter)) {
ext_encounter <- params@ext_encounter
ext_encounter[] <- 0
}

assert_that(is.array(ext_encounter),
Expand Down
3 changes: 2 additions & 1 deletion man/newMultispeciesParams.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/setExtEncounter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/setParams.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5fb6f2a

Please sign in to comment.