Skip to content

Commit f36f994

Browse files
committed
validSpeciesParams() now also sets default for 'p' to be equal to 'n'.
1 parent 964f38f commit f36f994

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

Diff for: DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Authors@R: c(person("Gustav", "Delius", email="[email protected]",
1919
comment = c(ORCID = "0000-0002-8478-3430")),
2020
person("Richard", "Southwell", email="[email protected]",
2121
role=c("ctb", "cph")))
22-
Version: 2.5.3.9001
22+
Version: 2.5.3.9002
2323
License: GPL-3
2424
Imports:
2525
assertthat,

Diff for: R/validSpeciesParams.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#' wrong capitalisation or missing underscores and issues a warning if it
3939
#' detects such a name.
4040
#'
41-
#' `validSpeciesParams()` first calls `validateGivenSpeciesParams()` but then
41+
#' `validSpeciesParams()` first calls `validGivenSpeciesParams()` but then
4242
#' goes further by adding default values for species parameters that were not
4343
#' provided. The function sets default values if any of the following species
4444
#' parameters are missing or NA:
@@ -48,6 +48,7 @@
4848
#' * `alpha` is set to `0.6`
4949
#' * `interaction_resource` is set to `1`
5050
#' * `n` is set to `3/4`
51+
#' * `p` is set to `n`
5152
#'
5253
#' Note that the species parameters returned by these functions are not
5354
#' guaranteed to produce a viable model. More checks of the parameters are
@@ -69,6 +70,7 @@ validSpeciesParams <- function(species_params) {
6970
sp <- set_species_param_default(sp, "alpha", 0.6)
7071
sp <- set_species_param_default(sp, "interaction_resource", 1)
7172
sp <- set_species_param_default(sp, "n", 3/4)
73+
sp <- set_species_param_default(sp, "p", sp$n)
7274
return(sp)
7375
}
7476

Diff for: man/completeSpeciesParams.Rd

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: man/validSpeciesParams.Rd

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)