Learn R Programming

⚠️There's a newer version (0.6.0) of this package.Take me there.

ypr

Introduction

ypr is an R package that implements equilibrium-based yield per recruit methods. Yield per recruit methods can used to estimate the optimal yield for a fish population (Walters and Martell 2004). The yield can be based on the number of fish caught (or harvested) or biomass for all fish or just large (trophy) individuals.

The key life history parameters are

  • The growth coefficient (k) and mean maximum length (Linf) from the Von Bertalanffy growth curve
  • The length at which 50% mature (Ls)
  • The length at which 50% vulnerable to harvest (Lv)
  • The interval annual natural mortality rate (n)
  • The lifetime number of spawners per spawner at low density (Rk)

The calculations do not account for stochasticity, predator-prey dynamics, angler responses or density-dependent growth.

A shiny app is available at https://poissonconsulting.shinyapps.io/shinyypr/.

Demonstration

Schedule

library(ypr)
population <- ypr_population(Rk = 5, Ls = 50, Rmax = 100, rho = 0.6)
ypr_plot_schedule(population, x = "Length", y = "Spawning")

head(ypr_tabulate_schedule(population))
#> # A tibble: 6 x 11
#>     Age Length Weight Fecundity Spawning NaturalMortality Vulnerability
#>   <int>  <dbl>  <dbl>     <dbl>    <dbl>            <dbl>         <dbl>
#> 1     1   13.9   27.0      27.0 3.13e-56              0.2      3.13e-56
#> 2     2   25.9  174.      174.  2.91e-29              0.2      2.91e-29
#> 3     3   36.2  476.      476.  1.04e-14              0.2      1.04e-14
#> 4     4   45.1  918.      918.  3.46e- 5              0.2      3.46e- 5
#> 5     5   52.8 1469.     1469.  9.95e- 1              0.2      9.95e- 1
#> 6     6   59.3 2090.     2090.  1.00e+ 0              0.2      1.00e+ 0
#> # … with 4 more variables: Retention <dbl>, FishingMortality <dbl>,
#> #   Survivorship <dbl>, FishedSurvivorship <dbl>

Fish

ypr_plot_fish(population, color = "white")

head(ypr_tabulate_fish(population))
#> # A tibble: 6 x 7
#>     Age Survivors Spawners   Caught Harvested Released HandlingMortalities
#>   <dbl>     <dbl>    <dbl>    <dbl>     <dbl>    <dbl>               <dbl>
#> 1     1      70.1 2.19e-54 4.39e-55  1.76e-55 2.63e-55                   0
#> 2     2      56.1 1.63e-27 3.26e-28  1.30e-28 1.96e-28                   0
#> 3     3      44.9 4.68e-13 9.36e-14  3.74e-14 5.62e-14                   0
#> 4     4      35.9 1.24e- 3 2.48e- 4  9.93e- 5 1.49e- 4                   0
#> 5     5      28.7 2.86e+ 1 5.72e+ 0  2.29e+ 0 3.43e+ 0                   0
#> 6     6      21.1 2.11e+ 1 4.23e+ 0  1.69e+ 0 2.54e+ 0                   0

Stock-Recruitment

ypr_plot_sr(population)

ypr_tabulate_sr(population)
#> # A tibble: 3 x 7
#>   Type        pi     u    Eggs Recruits Spawners Fecundity
#>   <chr>    <dbl> <dbl>   <dbl>    <dbl>    <dbl>     <dbl>
#> 1 unfished 0     0     286350.     80      159.      3600.
#> 2 actual   0.2   0.08  167831.     70.1    108.      3112.
#> 3 optimal  0.458 0.183  84129.     54.0     63.7     2641.

Yield

ypr_tabulate_yield(population)
#> # A tibble: 2 x 8
#>   Type       pi     u Yield   Age Length Weight Effort
#>   <chr>   <dbl> <dbl> <dbl> <dbl>  <dbl>  <dbl>  <dbl>
#> 1 actual  0.2   0.08   8.63  7.67   65.8  3112.   2.12
#> 2 optimal 0.458 0.183 11.7   6.87   62.6  2641.   5.82
ypr_plot_yield(population)

Uncertainty

library(ggplot2)
populations <- ypr_populations(Rk = c(3, 7), Ls = c(40, 60), Rmax = 100)
ypr_plot_yield(populations, plot_values = FALSE) +
  facet_grid(Rk ~ Ls)

Installation

To install the latest release from CRAN

install.packages("ypr")

To install the developmental version from GitHub

# install.packages("remotes")
remotes::install_github("poissonconsulting/ypr")

Information

For more information see the Get Started vignette.

Interaction

To interactively explore the effects of altering individual parameters on the schedule, stock-recruitment and yield see the ypr shiny app.

Creditation

Development of ypr was partially supported by the Habitat Conservation Trust Foundation and the Ministry of Forests, Lands and Natural Resource Operations.

The hex was designed by The Forest.

Contribution

Please report any issues.

Pull requests are always welcome.

Code of Conduct

Please note that the ypr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

References

Walters, Carl J., and Steven J. D. Martell. 2004. Fisheries Ecology and Management. Princeton, N.J: Princeton University Press.

Copy Link

Version

Install

install.packages('ypr')

Monthly Downloads

172

Version

0.5.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Joe Thorley

Last Published

July 3rd, 2021

Functions in ypr (0.5.2)

as_ypr_population

Coerce to a Population Parameter Object
params

Parameter Descriptions for ypr Functions
kootenay_bt_13

Kootenay Lake Bull Trout Population Parameters (2013)
quesnel_bt

Quesnel Lake Bull Trout Population Parameters
ypr_detabulate_parameters

Detabulate Population Parameters
ypr_populations_expand

Expand Populations
ypr_optimize

Optimize Capture
ypr_populations

Populations
ypr_length_at_age

Length At Age
kootenay_rb

Kootenay Lake Rainbow Trout Population Parameters
ypr_plot_schedule

Plot Population Schedule Terms
ypr-package

ypr: Yield Per Recruit
ypr_plot_biomass

Plot Biomass
ypr_exploitation

Exploitation Probability
ypr_population_names

Population Names
update.ypr_population

Update Population Parameters
ypr_plot_sr

Plot Stock-Recruitment Curve
ypr_plot_yield.ypr_populations

Plot Yield by Exploitation/Capture Probability
ypr_schedule

Life-History Schedule
ypr_population

Population Parameters
ypr_plot_fish

Plot Fish
ypr_tabulate_sr

Tabulate Stock-Recruitment Parameters
ypr_yield

Yield
ypr_age_at_length

Age At Length
ypr_report

Report
update.ypr_populations

Update Population Parameters
ypr_tabulate_fish

Tabulate Fish Numbers
ypr_tabulate_yield

Tabulate Yield
ypr_tabulate_yields

Tabulate Yields
ypr_yields

Yields
ypr_tabulate_biomass

Tablulate Biomass (and Eggs)
ypr_plot_yield.ypr_population

Plot Yield by Exploitation/Capture Probability
quesnel_rb

Quesnel Lake Rainbow Trout Population Parameters
ypr_plot_yield

Plot Yield by Capture
ypr_sr

Stock-Recruitment Parameters
quesnel_lt

Quesnel Lake Lake Trout Population Parameters
ypr_tabulate_parameters

Tabulate Population Parameters
as_ypr_populations

Coerce to a Populations Parameter Object
plot.ypr_population

Plot Population Schedule
chilliwack_bt_05

Chilliwack Lake Bull Trout Populations Parameters (2005)
kootenay_rb_13

Kootenay Lake Rainbow Trout Population Parameters (2013)
adams_bt_03

Adams Lake Bull Trout Population Parameters (2003)