Skip to contents

These functions check the validity of a species parameter frame and, where necessary, make corrections. validGivenSpeciesParams() only checks and corrects the given species parameters but does not add default values for species parameters that were not provided. validSpeciesParams() first calls validGivenSpeciesParams() but then goes further by adding default values for species parameters that were not provided.

Usage

validSpeciesParams(species_params)

validGivenSpeciesParams(species_params)

Arguments

species_params

The user-supplied species parameter data frame

Value

For validSpeciesParams(): A valid species parameter data frame with additional parameters with default values.

For validGivenSpeciesParams(): A valid species parameter data frame without additional parameters.

Details

validGivenSpeciesParams() checks the validity of the given species parameter It throws an error if

  • the species column does not exist or contains duplicates

  • the maximum size is not specified for all species

If a weight-based parameter is missing but the corresponding length-based parameter is given, as well as the a and b parameters for length-weight conversion, then the weight-based parameters are added. If both length and weight are given, then weight is used and a warning is issued if the two are inconsistent.

If a w_inf column is given but no w_max then the value from w_inf is used. This is for backwards compatibility. But note that the von Bertalanffy parameter w_inf is not the maximum size of the largest individual, but the asymptotic size of an average individual.

Some inconsistencies in the size parameters are resolved as follows:

  • Any w_mat that is not smaller than w_max is set to w_max / 4.

  • Any w_mat25 that is not smaller than w_mat is set to NA.

  • Any w_min that is not smaller than w_mat is set to 0.001 or w_mat /10, whichever is smaller.

  • Any w_repro_max that is not larger than w_mat is set to 4 * w_mat.

The row names of the returned data frame will be the species names. If species_params was provided as a tibble it is converted back to an ordinary data frame.

The function tests for some typical misspellings of parameter names, like wrong capitalisation or missing underscores and issues a warning if it detects such a name.

validSpeciesParams() first calls validateGivenSpeciesParams() but then goes further by adding default values for species parameters that were not provided. The function sets default values if any of the following species parameters are missing or NA:

  • w_repro_max is set to w_max

  • w_mat is set to w_max/4

  • w_min is set to 0.001

  • alpha is set to 0.6

  • interaction_resource is set to 1

  • n is set to 3/4

Note that the species parameters returned by these functions are not guaranteed to produce a viable model. More checks of the parameters are performed by the individual rate-setting functions (see setParams() for the list of these functions).