Check validity of species parameters and set defaults for missing but required parameters

validSpeciesParams(species_params)

Arguments

species_params

The user-supplied species parameter data frame

Value

A valid species parameter data frame

This function throws an error if

  • the species column does not exist or contains duplicates

  • the w_inf column does not exist or contains NAs or is not numeric

It sets default values if any of the following are missing or NA

  • w_mat is set to w_inf/4

  • w_min is set to 0.001

  • alpha is set to 0.6

  • interaction_resource is set to 1

Any w_mat that is given that is not smaller than w_inf is set to w_inf / 4.

Any w_mat25 that is given that is not smaller than w_mat is set to w_mat * 3^(-0.1).

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.