Calculate Minimum and Maximum Size Limits for Fish Species
create_min_max.Rd
This function processes a data frame containing fish life history information to compute minimum and maximum size limits for each species based on their maximum length to check your annotations against. It uses the maximum length data from genus and family levels to fill in any missing maximum lengths at the species level. The resulting data frame includes the computed minimum and maximum size limits in millimeters.
Arguments
- life_history
A data frame containing fish life history information. This data frame should include columns for
family
,genus
,species
, andlength_max_cm
(the maximum length in centimeters). Missing values inlength_max_cm
will be filled using average lengths from genus or family levels if available.- minimum
A numeric value representing the multiplier to calculate the minimum size limit. The final minimum size limit in millimeters is computed as
minimum * length_max_mm
.- maximum
A numeric value representing the multiplier to calculate the maximum size limit. The final maximum size limit in millimeters is computed as
maximum * length_max_mm
.
Value
A data frame with the following columns:
family: Fish family.
genus: Fish genus.
species: Fish species.
min_length_mm: Calculated minimum size limit in millimeters.
max_length_mm: Calculated maximum size limit in millimeters.
length_max_mm: Maximum length of the fish in millimeters.
Rows with missing minimum length values are excluded from the result.