| Title: | Get Priors for Life-History Traits of Fishes |
|---|---|
| Description: | This package extracts information the the rfishbase R package to inform priors for parameters that are commonly included in assessment models of marine resources. The parameters of interest are life-history parameters such as natural mortality but can also pertain to parameters that are fishery-related but have implausible values due to life-history traits such as selectivity parameters. |
| Authors: | Kelli F. Johnson [aut, cre] (ORCID: <https://orcid.org/0000-0002-5149-451X>), Jennifer S. Bigman, [aut] (ORCID: <https://orcid.org/0000-0001-8070-3061>), Eric J. Ward [aut] (ORCID: <https://orcid.org/0000-0002-4359-0296>), Carl Boettiger [aut] (ORCID: <https://orcid.org/0000-0002-1642-628X>) |
| Maintainer: | Kelli F. Johnson <[email protected]> |
| License: | GPL (>= 3) | file LICENSE |
| Version: | 0.1.1.0 |
| Built: | 2026-10-07 08:27:14 UTC |
| Source: | https://github.com/NOAA-FIMS/fishprior |
rfishbase is Up to DateThis function compares the installed version of the rfishbase package
with the latest version available on CRAN. It prints a message if the
installed version is outdated.
check_rfishbase_version()check_rfishbase_version()
check_rfishbase_version()check_rfishbase_version()
Get information out of the prior class
get_distribution(object) ## S4 method for signature 'prior' get_distribution(object) get_parameters(object) ## S4 method for signature 'prior' get_parameters(object) get_trait(object) ## S4 method for signature 'prior' get_trait(object) get_group(object) ## S4 method for signature 'prior' get_group(object) get_type(object) ## S4 method for signature 'prior' get_type(object) get_data(object) ## S4 method for signature 'prior' get_data(object)get_distribution(object) ## S4 method for signature 'prior' get_distribution(object) get_parameters(object) ## S4 method for signature 'prior' get_parameters(object) get_trait(object) ## S4 method for signature 'prior' get_trait(object) get_group(object) ## S4 method for signature 'prior' get_group(object) get_type(object) ## S4 method for signature 'prior' get_type(object) get_data(object) ## S4 method for signature 'prior' get_data(object)
object |
An object of class |
Queries FishBase via the rfishbase package and returns raw data tables containing life-history traits relevant for meta-analysis or prior construction.
get_fishbase_traits(spec_names = NULL)get_fishbase_traits(spec_names = NULL)
spec_names |
A character vector of species names (e.g.,
|
A tibble with metadata and trait information.
TODO: Provide more details on the parameter.
make_growth_coefficient_prior(data, type = c("informative", "diffuse"))make_growth_coefficient_prior(data, type = c("informative", "diffuse"))
data |
A data frame for a single species because you might need more than one trait to create a prior. |
type |
A character string indicating the type of prior. The default is "informative". |
The Hamel–Cope prior for natural mortality is thought to be a good, informative prior for natural mortality. It is based on the maximum age of a fish species.
make_informative_mortality_prior(log_maximum_age)make_informative_mortality_prior(log_maximum_age)
log_maximum_age |
A numeric value representing the maximum age of the fish species on the log scale. This value must be greater than 0. |
The Hamel–Cope prior is based on the assumption that natural mortality follows a lognormal distribution. The mean of the lognormal distribution is calculated as 5.40 divided by the maximum age of the fish species. The standard deviation of the lognormal distribution is set to 0.31.
An informative lognormal distribution is returned using the prior class.
Make a prior for natural mortality using either an informative or diffuse prior. The informative prior is based on the Hamel–Cope prior, which is based on the maximum age of a fish species. The diffuse prior is based on the estimated natural mortality of a fish species.
make_mortality_prior(data, type = c("diffuse", "informative"))make_mortality_prior(data, type = c("diffuse", "informative"))
data |
A data frame returned by |
type |
A character string indicating the type of prior to be created.
Either |
A tibble is returned that contains three columns, "name" from the input
data frame with the species name, "parameter" specifying which parameter
the prior is for, and "prior" that contains the S4 class prior.
Summarize FishBase trait data into log-transformed traits
summarize_fishbase_traits(fb)summarize_fishbase_traits(fb)
fb |
A tibble returned by |
A tibble grouped by Species and trait with log-transformed stats.
An example of trait information obtained from FishBase for three species, European Hake, Alaska pollock, and sablefish.
traits_exampletraits_example
whoA data frame with 19 rows and 6 columns:
The latin/scientific name of the species
A string in an R-code style indicating which trait the values are for
The mean and standard deviation of the given trait on the normal scale
The mean and standard error of the given trait
https://docs.ropensci.org/rfishbase/
The resultant trait names are the snake-case names that are used in
FishLife and are preceded by log( to indicate that the traits are in
log space.
translate_trait_names(trait)translate_trait_names(trait)
trait |
A character vector of trait names from FishBase. |
A character vector of trait names in snake_case format rather than the format found in FishBase, which is often shorted versions of the trait names.
translate_trait_names("Loo") translate_trait_names("K") translate_trait_names(c("Loo", "K", "M"))translate_trait_names("Loo") translate_trait_names("K") translate_trait_names(c("Loo", "K", "M"))