Title: | Yield Per Recruit |
Version: | 0.6.0 |
Description: | An implementation of equilibrium-based yield per recruit methods. Yield per recruit methods can used to estimate the optimal yield for a fish population as described by Walters and Martell (2004) <isbn:0-691-11544-3>. The yield can be based on the number of fish caught (or harvested) or biomass caught for all fish or just large (trophy) individuals. |
License: | MIT + file LICENSE |
URL: | https://github.com/poissonconsulting/ypr |
BugReports: | https://github.com/poissonconsulting/ypr/issues |
Depends: | R (≥ 3.6) |
Imports: | chk, ggplot2, graphics, lifecycle, purrr, stats, tibble, tidyplus, tools, yesno |
Suggests: | covr, knitr, readr, rmarkdown, rstudioapi, scales, testthat (≥ 3.0.0), tidyr, usethis, withr |
VignetteBuilder: | knitr |
ByteCompile: | true |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
Language: | en-US |
LazyData: | true |
RoxygenNote: | 7.2.1 |
NeedsCompilation: | no |
Packaged: | 2022-08-29 22:15:01 UTC; joe |
Author: | Joe Thorley |
Maintainer: | Joe Thorley <joe@poissonconsulting.ca> |
Repository: | CRAN |
Date/Publication: | 2022-08-29 22:30:03 UTC |
ypr: Yield Per Recruit
Description
An implementation of equilibrium-based yield per recruit methods. Yield per recruit methods can used to estimate the optimal yield for a fish population as described by Walters and Martell (2004) <isbn:0-691-11544-3>. The yield can be based on the number of fish caught (or harvested) or biomass caught for all fish or just large (trophy) individuals.
Author(s)
Maintainer: Joe Thorley joe@poissonconsulting.ca (ORCID)
Other contributors:
Ayla Pearson (ORCID) [contributor]
Poisson Consulting [copyright holder, funder]
See Also
Useful links:
Report bugs at https://github.com/poissonconsulting/ypr/issues
Adams Lake Bull Trout Population Parameters (2003)
Description
The population parameters for Bull Trout in Adams Lake from Bison et al (2003)
Usage
adams_bt_03
Format
An object of class ypr_population()
.
References
Bison, R., O’Brien, D., and Martell, S.J.D. 2003. An Analysis of Sustainable Fishing Options for Adams Lake Bull Trout Using Life History and Telemetry Data. BC Ministry of Water Land and Air Protection, Kamloops, B.C.
See Also
Other data:
chilliwack_bt_05
,
kootenay_bt_13
,
kootenay_rb_13
,
kootenay_rb
,
quesnel_bt
,
quesnel_lt
,
quesnel_rb
Examples
adams_bt_03
ypr_plot_yield(adams_bt_03)
Coerce to an Ecotypes Object
Description
Coerce to an Ecotypes Object
Usage
as_ypr_ecotypes(x, ...)
## S3 method for class 'data.frame'
as_ypr_ecotypes(x, ...)
## S3 method for class 'ypr_population'
as_ypr_ecotypes(x, ...)
## S3 method for class 'ypr_populations'
as_ypr_ecotypes(x, ...)
## S3 method for class 'ypr_ecotypes'
as_ypr_ecotypes(x, ...)
Arguments
x |
The object to coerce. |
... |
Additional arguments. |
Value
An object of class ypr_ecotypes.
Methods (by class)
-
as_ypr_ecotypes(data.frame)
: Coerce a data.frame to an Ecotypes Object -
as_ypr_ecotypes(ypr_population)
: Coerce a Population Object to an Ecotypes Object -
as_ypr_ecotypes(ypr_populations)
: Coerce a Populations Object to an Ecotypes Object -
as_ypr_ecotypes(ypr_ecotypes)
: Coerce an Ecotypes Object to an Ecotypes Object
See Also
Other ecotypes:
ypr_ecotypes()
Examples
as_ypr_ecotypes(as.data.frame(ypr_ecotypes(Ls = c(10, 15, 20))))
as_ypr_ecotypes(ypr_population())
as_ypr_ecotypes(ypr_populations(Ls = c(10, 15, 20)))
as_ypr_ecotypes(ypr_ecotypes(Ls = c(10, 15, 20)))
Coerce to a Population Object
Description
Coerce to a Population Object
Usage
as_ypr_population(x, ...)
## S3 method for class 'data.frame'
as_ypr_population(x, ...)
## S3 method for class 'ypr_population'
as_ypr_population(x, ...)
## S3 method for class 'ypr_populations'
as_ypr_population(x, ...)
## S3 method for class 'ypr_ecotypes'
as_ypr_population(x, ...)
## S3 method for class 'data.frame'
as_ypr_populations(x, ...)
Arguments
x |
The object to coerce. |
... |
Unused. |
Value
An object of class ypr_population.
Methods (by class)
-
as_ypr_population(data.frame)
: Coerce a data.frame to an Population Object -
as_ypr_population(ypr_population)
: Coerce a Population Object to an Population Object -
as_ypr_population(ypr_populations)
: Coerce a Populations Object of length 1 to a Population Object -
as_ypr_population(ypr_ecotypes)
: Coerce a Ecotypes Object of length 1 to a Population Object
Functions
-
as_ypr_populations(data.frame)
: Coerce a data.frame to a Populations Object
Examples
as_ypr_population(as.data.frame(ypr_population()))
as_ypr_population(ypr_populations())
as_ypr_population(ypr_populations())
as_ypr_population(ypr_ecotypes())
as_ypr_populations(as.data.frame(ypr_populations(Rk = c(3, 4))))
Coerce to a Populations Object
Description
Coerce to a Populations Object
Usage
as_ypr_populations(x, ...)
## S3 method for class 'ypr_population'
as_ypr_populations(x, ...)
## S3 method for class 'ypr_populations'
as_ypr_populations(x, ...)
## S3 method for class 'ypr_ecotypes'
as_ypr_populations(x, ...)
Arguments
x |
The object to coerce. |
... |
Unused. |
Value
An object of class ypr_ecotypes.
Methods (by class)
-
as_ypr_populations(ypr_population)
: Coerce a Population Object to an Population Object -
as_ypr_populations(ypr_populations)
: Coerce a Populations Object of length 1 to a Population Object -
as_ypr_populations(ypr_ecotypes)
: Coerce a Ecotypes Object of length 1 to a Population Object
See Also
Other populations:
chilliwack_bt_05
,
ypr_plot_yield()
,
ypr_populations_expand()
,
ypr_populations()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Examples
as_ypr_populations(ypr_population())
as_ypr_populations(ypr_populations())
as_ypr_populations(ypr_ecotypes())
Check Ecotypes
Description
Checks if an ypr_ecotypes object with valid parameter values.
Usage
check_ecotypes(x, x_name = NULL)
Arguments
x |
The object to check. |
x_name |
A string of the name of object x or NULL. |
Value
An informative error if the test fails or an invisible copy of x.
See Also
Other check:
check_populations()
,
check_population()
Examples
check_ecotypes(ypr_ecotypes())
Check Population
Description
Checks if an ypr_population object with valid parameter values.
Usage
check_population(x, x_name = NULL)
Arguments
x |
The object to check. |
x_name |
A string of the name of object x or NULL. |
Value
An informative error if the test fails or an invisible copy of x.
See Also
Other check:
check_ecotypes()
,
check_populations()
Examples
check_population(ypr_population())
Check Populations
Description
Checks if an ypr_populations object with valid parameter values.
Usage
check_populations(x, x_name = NULL)
Arguments
x |
The object to check. |
x_name |
A string of the name of object x or NULL. |
Value
An informative error if the test fails or an invisible copy of x.
See Also
Other check:
check_ecotypes()
,
check_population()
Examples
check_populations(ypr_populations())
Chilliwack Lake Bull Trout Populations Parameters (2005)
Description
The populations parameters for Bull Trout in Chilliwack Lake from Taylor (2005)
Usage
chilliwack_bt_05
Format
An object of class ypr_populations()
.
References
Taylor, J.L. 2005. Sustainability of the Chilliwack Lake Char Fishery. Ministry of Water, Land and Air Protection, Surrey, B.C.
See Also
Other populations:
as_ypr_populations()
,
ypr_plot_yield()
,
ypr_populations_expand()
,
ypr_populations()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Other data:
adams_bt_03
,
kootenay_bt_13
,
kootenay_rb_13
,
kootenay_rb
,
quesnel_bt
,
quesnel_lt
,
quesnel_rb
Examples
chilliwack_bt_05
yield <- ypr_tabulate_yield(chilliwack_bt_05, type = "optimal")
yield$pi <- round(yield$pi, 2)
yield <- yield[c("Llo", "Hm", "Rk", "pi")]
yield <- tidyr::spread(yield, Rk, pi)
yield <- yield[order(-yield$Hm), ]
yield
## Not run:
ypr_plot_yield(chilliwack_bt_05, plot_values = FALSE) +
ggplot2::facet_grid(Rk ~ Hm) +
ggplot2::aes(group = Llo, linetype = Llo)
## End(Not run)
Tests if is a Population, Populations or Ecotypes
Description
Tests if is a Population, Populations or Ecotypes
Usage
is.ypr_population(x)
is_ypr_population(x)
is.ypr_populations(x)
is_ypr_populations(x)
is.ypr_ecotypes(x)
is_ypr_ecotypes(x)
Arguments
x |
The object to test. |
Functions
-
is_ypr_population()
: Test if is a Population -
is.ypr_populations()
: Test if is a Populations -
is_ypr_populations()
: Test if is a Populations -
is.ypr_ecotypes()
: Test if is an Ecotypes -
is_ypr_ecotypes()
: Test if is an Ecotypes
Examples
is.ypr_population(ypr_population())
is_ypr_population(ypr_population())
is.ypr_populations(ypr_populations())
is_ypr_population(ypr_populations())
is.ypr_ecotypes(ypr_ecotypes())
is_ypr_ecotypes(ypr_ecotypes())
Kootenay Lake Bull Trout Population Parameters (2013)
Description
The population parameters for Bull Trout in Kootenay Lake from Andrusak and Thorley (2013)
Usage
kootenay_bt_13
Format
An object of class ypr_population()
.
Details
The estimates should not be used for management.
References
Andrusak, G.F., and Thorley, J.L. 2013. Kootenay Lake Exploitation Study: Fishing and Natural Mortality of Large Rainbow Trout and Bull Trout: 2013 Annual Report. A Poisson Consulting Ltd. and Redfish Consulting Ltd. Report, Habitat Conservation Trust Foundation, Victoria, BC.
See Also
Other data:
adams_bt_03
,
chilliwack_bt_05
,
kootenay_rb_13
,
kootenay_rb
,
quesnel_bt
,
quesnel_lt
,
quesnel_rb
Examples
kootenay_bt_13
ypr_plot_yield(kootenay_bt_13)
Kootenay Lake Rainbow Trout Population Parameters
Description
The population parameters for Rainbow Trout in Kootenay Lake.
Usage
kootenay_rb
Format
An object of class ypr_population()
.
Details
The estimates are liable to change and should not be used for management.
References
Thorley, J.L., and Andrusak, G.F. 2017. The fishing and natural mortality of large, piscivorous Bull Trout and Rainbow Trout in Kootenay Lake, British Columbia (2008–2013). PeerJ 5: e2874. doi:10.7717/peerj.2874.
See Also
Other data:
adams_bt_03
,
chilliwack_bt_05
,
kootenay_bt_13
,
kootenay_rb_13
,
quesnel_bt
,
quesnel_lt
,
quesnel_rb
Examples
kootenay_rb
ypr_plot_yield(kootenay_rb)
Kootenay Lake Rainbow Trout Population Parameters (2013)
Description
The population parameters for Rainbow Trout in Kootenay Lake from Andrusak and Thorley (2013)
Usage
kootenay_rb_13
Format
An object of class ypr_population()
.
Details
The estimates should not be used for management.
References
Andrusak, G.F., and Thorley, J.L. 2013. Kootenay Lake Exploitation Study: Fishing and Natural Mortality of Large Rainbow Trout and Bull Trout: 2013 Annual Report. A Poisson Consulting Ltd. and Redfish Consulting Ltd. Report, Habitat Conservation Trust Foundation, Victoria, BC.
See Also
Other data:
adams_bt_03
,
chilliwack_bt_05
,
kootenay_bt_13
,
kootenay_rb
,
quesnel_bt
,
quesnel_lt
,
quesnel_rb
Examples
kootenay_rb_13
ypr_plot_yield(kootenay_rb_13)
Parameter Descriptions for ypr Functions
Description
Parameter Descriptions for ypr Functions
Arguments
tmax |
The maximum age (yr). |
k |
The VB growth coefficient (yr-1). |
Linf |
The VB mean maximum length (cm). |
t0 |
The (theoretical) age at zero length (yr). |
k2 |
The VB growth coefficient after length L2 (yr-1). |
Linf2 |
The VB mean maximum length after length L2 (cm). |
L2 |
The length (or age if negative) at which growth switches from the first to second phase (cm or yr). |
Wb |
The weight (as a function of length) scaling exponent. |
Ls |
The length (or age if negative) at which 50 % mature (cm or yr). |
Sp |
The maturity (as a function of length) power. |
es |
The annual probability of a mature fish spawning. |
Sm |
The spawning mortality probability. |
fb |
The fecundity (as a function of weight) scaling exponent. |
tR |
The age from which survival is density-independent (yr). |
BH |
Recruitment follows a Beverton-Holt (1) or Ricker (0) relationship. |
Rk |
The lifetime spawners per spawner at low density (or the egg to tR survival if between 0 and 1). |
n |
The annual interval natural mortality rate from age tR. |
nL |
The annual interval natural mortality rate from length Ln. |
Ln |
The length (or age if negative) at which the natural mortality rate switches from n to nL (cm or yr). |
Lv |
The length (or age if negative) at which 50 % vulnerable to harvest (cm or yr). |
Vp |
The vulnerability to harvest (as a function of length) power. |
Llo |
The lower harvest slot length (cm). |
Lup |
The upper harvest slot length (cm). |
Nc |
The slot limits non-compliance probability. |
pi |
A vector of probabilities of capture to calculate the yield for. |
rho |
The release probability. |
Hm |
The hooking mortality probability. |
Rmax |
The number of recruits at the carrying capacity (ind). |
Wa |
The (extrapolated) weight of a 1 cm individual (g). |
fa |
The (theoretical) fecundity of a 1 g female (eggs). |
q |
The catchability (annual probability of capture) for a unit of effort. |
RPR |
The relative proportion of recruits that are of the ecotype. |
all |
A flag specifying whether to include all parameter values. |
u |
A flag specifying whether to plot the exploitation rate as opposed to the capture rate. |
percent |
A flag specifying whether to plot the number of fish as a percent or frequency (the default). |
color |
A string of the color around each bar (or NULL). |
population |
An object of class |
populations |
An object of class |
ecotypes |
An object of class |
plot_values |
A flag specifying whether to plot the actual and optimal values. |
Ly |
The minimum length (trophy) fish to consider when calculating the yield (cm). |
harvest |
A flag specifying whether to calculate the yield for harvested fish or captures. |
biomass |
A flag specifying whether to calculate the yield in terms of the biomass versus number of individuals. |
title |
A string of the report title. |
date |
A date of the report date. |
file |
A string of the path to the file (without the extension). |
binwidth |
A positive integer of the width of the bins for grouping. |
type |
A string indicating whether to include 'both' or just the 'actual' or 'optimal' yield. |
object |
The population or populations. |
... |
Unused parameters. |
expand |
A flag specifying whether to expand parameter combinations. |
view |
A flag specifying whether to view the report (after rendering it to html). |
ask |
A flag specifying whether to ask before overwriting or creating a file. |
description |
A string describing the population. |
age |
A numeric vector of the age (yr). |
length |
A numeric vector of the length (cm). |
names |
A character vector of unique ecotype names. |
x |
The object to coerce. |
Plot Population Schedule
Description
Plot Population Schedule
Usage
## S3 method for class 'ypr_population'
plot(x, type = "b", ...)
Arguments
x |
The population to plot. |
type |
A string specifying the plot type. Possible values include 'b', 'p' and 'l'. |
... |
Additional arguments passed to graphics::plot function. |
Value
An invisible copy of the original object.
See Also
Examples
## Not run:
plot(ypr_population())
## End(Not run)
Quesnel Lake Bull Trout Population Parameters
Description
The population parameters for Bull Trout in Quesnel Lake, BC.
Usage
quesnel_bt
Format
An object of class ypr_population()
.
Details
The estimates are liable to change and should not be used for management.
See Also
Other data:
adams_bt_03
,
chilliwack_bt_05
,
kootenay_bt_13
,
kootenay_rb_13
,
kootenay_rb
,
quesnel_lt
,
quesnel_rb
Examples
quesnel_bt
ypr_plot_yield(quesnel_bt)
Quesnel Lake Lake Trout Population Parameters
Description
The population parameters for Lake Trout in Quesnel Lake, BC.
Usage
quesnel_lt
Format
An object of class ypr_population()
.
Details
The estimates are liable to change and should not be used for management.
See Also
Other data:
adams_bt_03
,
chilliwack_bt_05
,
kootenay_bt_13
,
kootenay_rb_13
,
kootenay_rb
,
quesnel_bt
,
quesnel_rb
Examples
quesnel_lt
ypr_plot_yield(quesnel_lt)
Quesnel Lake Rainbow Trout Population Parameters
Description
The population parameters for Rainbow Trout in Quesnel Lake, BC.
Usage
quesnel_rb
Format
An object of class ypr_population()
.
Details
The estimates are liable to change and should not be used for management.
See Also
Other data:
adams_bt_03
,
chilliwack_bt_05
,
kootenay_bt_13
,
kootenay_rb_13
,
kootenay_rb
,
quesnel_bt
,
quesnel_lt
Examples
quesnel_rb
ypr_plot_yield(quesnel_rb)
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
- tibble
Age At Length
Description
Age At Length
Usage
ypr_age_at_length(population, length)
Arguments
population |
An object of class |
length |
A numeric vector of the length (cm). |
Value
A double vector of the lengths.
See Also
Other calculate:
ypr_exploitation()
,
ypr_length_at_age()
,
ypr_optimize()
,
ypr_yields()
,
ypr_yield()
Examples
ypr_age_at_length(ypr_population(), seq(0, 100, by = 10))
Detabulate Population Parameters
Description
Detabulate Population Parameters
Usage
ypr_detabulate_parameters(x)
Arguments
x |
A data frame with columns Parameter and Value specifying one or more parameters and their values. |
Value
An object of class ypr_population()
See Also
Other tabulate:
ypr_report()
,
ypr_tabulate_biomass()
,
ypr_tabulate_fish()
,
ypr_tabulate_parameters()
,
ypr_tabulate_schedule()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Other parameters:
ypr_tabulate_parameters()
Examples
ypr_detabulate_parameters(ypr_tabulate_parameters(ypr_population()))
Create Ecotypes Object
Description
Creates an ypr_ecotypes object.
Usage
ypr_ecotypes(..., names = NULL)
Arguments
... |
Unused parameters. |
names |
A character vector of unique ecotype names. |
Value
An ypr_ecotypes()
objects
See Also
Other ecotypes:
as_ypr_ecotypes()
Examples
ypr_ecotypes(Linf = c(1, 2))
ypr_ecotypes(Linf = c(1, 2), t0 = c(0, 0.5))
Exploitation Probability
Description
Converts capture probabilities into exploitation probabilities based on the release and handling mortality probabilities where the probability of exploitation includes handling mortalities. The calculation assumes that a released fish cannot be recaught in the same year.
Usage
ypr_exploitation(object, pi = ypr_get_par(object))
Arguments
object |
The population or populations. |
pi |
A vector of capture probabilities to calculate the exploitation probabilities for. |
Details
In the case of no release (or 100% handling mortalities) the exploitation probability is identical to the capture probability. Otherwise it is less.
Value
A vector of exploitation probabilities.
See Also
Other calculate:
ypr_age_at_length()
,
ypr_length_at_age()
,
ypr_optimize()
,
ypr_yields()
,
ypr_yield()
Examples
ypr_exploitation(ypr_population(pi = 0.4))
ypr_exploitation(ypr_population(pi = 0.4, rho = 0.6, Hm = 0.2))
Get Parameter Value
Description
Get Parameter Value
Usage
ypr_get_par(object, par = "pi")
Arguments
object |
A ypr object. |
par |
A string of the parameter. |
Value
A numeric or integer scalar or vector of the parameter value.
Examples
ypr_get_par(ypr_population())
Length At Age
Description
Length At Age
Usage
ypr_length_at_age(population, age)
Arguments
population |
An object of class |
age |
A numeric vector of the age (yr). |
Value
A double vector of the lengths.
See Also
Other calculate:
ypr_age_at_length()
,
ypr_exploitation()
,
ypr_optimize()
,
ypr_yields()
,
ypr_yield()
Examples
ypr_length_at_age(ypr_population(), seq(0, 5, by = 0.5))
Population(s) or Ecotype Names
Description
Generates set of unique names based on differences in parameter values.
Usage
ypr_names(x, ...)
## S3 method for class 'ypr_population'
ypr_names(x, ...)
## S3 method for class 'ypr_populations'
ypr_names(x, ...)
## S3 method for class 'ypr_ecotypes'
ypr_names(x, ...)
Arguments
x |
An object of class ypr_population, ypr_populations or ypr_ecotypes. |
... |
Unused. |
Details
Parameter RPR is ignored because it is irrelevant to population(s) and does not distinguish between ecotypes.
Value
A character vector of the unique parameter based names.
Methods (by class)
-
ypr_names(ypr_population)
: Population Names -
ypr_names(ypr_populations)
: Populations Names -
ypr_names(ypr_ecotypes)
: Ecotypes Names
Examples
ypr_names(ypr_population())
ypr_names(ypr_populations())
ypr_names(ypr_populations())
Optimize Capture
Description
Finds the interval annual capture probability (pi) that maximises the yield for a given population.
Usage
ypr_optimize(object, Ly = 0, harvest = TRUE, biomass = FALSE)
Arguments
object |
The population or populations. |
Ly |
The minimum length (trophy) fish to consider when calculating the yield (cm). |
harvest |
A flag specifying whether to calculate the yield for harvested fish or captures. |
biomass |
A flag specifying whether to calculate the yield in terms of the biomass versus number of individuals. |
Value
The interval annual capture probability (pi) that maximises the yield.
See Also
Other calculate:
ypr_age_at_length()
,
ypr_exploitation()
,
ypr_length_at_age()
,
ypr_yields()
,
ypr_yield()
Examples
ypr_optimize(ypr_population())
Plot Biomass
Description
Produces a frequency histogram of the total fish 'Biomass' or 'Eggs' deposition by 'Age' class.
Usage
ypr_plot_biomass(population, y = "Biomass", color = NULL)
Arguments
population |
An object of class |
y |
A string of the term on the y-axis. |
color |
A string of the color around each bar (or NULL). |
Value
A ggplot2 object.
See Also
Other biomass:
ypr_tabulate_biomass()
Other plot:
ypr_plot_fish()
,
ypr_plot_schedule()
,
ypr_plot_sr()
,
ypr_plot_yield()
Examples
ypr_plot_biomass(ypr_population(), color = "white")
Plot Fish
Description
Produces a frequency histogram of the number of fish in the 'Survivors', 'Spawners', 'Caught', 'Harvested' or 'Released' categories by 'Length', 'Age' or 'Weight' class.
Usage
ypr_plot_fish(
population,
x = "Age",
y = "Survivors",
percent = FALSE,
binwidth = 1L,
color = NULL
)
Arguments
population |
An object of class |
x |
The object to coerce. |
y |
A string of the term on the y-axis. |
percent |
A flag specifying whether to plot the number of fish as a percent or frequency (the default). |
binwidth |
A positive integer of the width of the bins for grouping. |
color |
A string of the color around each bar (or NULL). |
Value
A ggplot2 object.
See Also
Other fish:
ypr_tabulate_fish()
Other plot:
ypr_plot_biomass()
,
ypr_plot_schedule()
,
ypr_plot_sr()
,
ypr_plot_yield()
Examples
ypr_plot_fish(ypr_population(), color = "white")
Plot Population or Ecotypes Schedule Terms
Description
Produces a bivariate line plot of two schedule terms.
Usage
ypr_plot_schedule(population, x = "Age", y = "Length")
Arguments
population |
An object of class |
x |
A string of the term on the x-axis. |
y |
A string of the term on the y-axis. |
Value
A ggplot2 object.
See Also
Other schedule:
ypr_tabulate_schedule()
Other plot:
ypr_plot_biomass()
,
ypr_plot_fish()
,
ypr_plot_sr()
,
ypr_plot_yield()
Examples
ypr_plot_schedule(ypr_population())
Plot Stock-Recruitment Curve
Description
Plot Stock-Recruitment Curve
Usage
ypr_plot_sr(
population,
Ly = 0,
harvest = TRUE,
biomass = FALSE,
plot_values = TRUE
)
Arguments
population |
An object of class |
Ly |
The minimum length (trophy) fish to consider when calculating the yield (cm). |
harvest |
A flag specifying whether to calculate the yield for harvested fish or captures. |
biomass |
A flag specifying whether to calculate the yield in terms of the biomass versus number of individuals. |
plot_values |
A flag specifying whether to plot the actual and optimal values. |
Value
A ggplot2 object.
See Also
Other sr:
ypr_sr()
,
ypr_tabulate_sr()
Other plot:
ypr_plot_biomass()
,
ypr_plot_fish()
,
ypr_plot_schedule()
,
ypr_plot_yield()
Examples
ypr_plot_sr(ypr_population(Rk = 10))
ypr_plot_sr(ypr_population(Rk = 10, BH = 0L))
Plot Yield by Capture
Description
Plots the 'Yield', 'Age', 'Length', 'Weight', 'Effort', or 'YPUE' by the annual interval capture/exploitation probability.
Usage
ypr_plot_yield(object, ...)
## Default S3 method:
ypr_plot_yield(
object,
y = "Yield",
pi = seq(0, 1, length.out = 100),
Ly = 0,
harvest = TRUE,
biomass = FALSE,
u = harvest,
plot_values = TRUE,
...
)
## S3 method for class 'ypr_populations'
ypr_plot_yield(
object,
y = "Yield",
pi = seq(0, 1, length.out = 100),
Ly = 0,
harvest = TRUE,
biomass = FALSE,
u = harvest,
plot_values = TRUE,
...
)
Arguments
object |
The population or populations. |
... |
Unused parameters. |
y |
A string of the term on the y-axis. |
pi |
A vector of probabilities of capture to calculate the yield for. |
Ly |
The minimum length (trophy) fish to consider when calculating the yield (cm). |
harvest |
A flag specifying whether to calculate the yield for harvested fish or captures. |
biomass |
A flag specifying whether to calculate the yield in terms of the biomass versus number of individuals. |
u |
A flag specifying whether to plot the exploitation rate as opposed to the capture rate. |
plot_values |
A flag specifying whether to plot the actual and optimal values. |
Value
A ggplot2 object.
Methods (by class)
-
ypr_plot_yield(default)
: Plot Yield by Capture -
ypr_plot_yield(ypr_populations)
: Plot Yield by Capture
See Also
Other populations:
as_ypr_populations()
,
chilliwack_bt_05
,
ypr_populations_expand()
,
ypr_populations()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Other yield:
ypr_tabulate_yield()
,
ypr_yields()
,
ypr_yield()
Other plot:
ypr_plot_biomass()
,
ypr_plot_fish()
,
ypr_plot_schedule()
,
ypr_plot_sr()
Examples
## Not run:
ypr_plot_yield(ypr_populations(
Rk = c(2.5, 4.6),
Llo = c(0, 60)
),
plot_values = FALSE
) +
ggplot2::facet_wrap(~Llo) +
ggplot2::aes_string(group = "Rk", color = "Rk") +
ggplot2::scale_color_manual(values = c("black", "blue"))
ypr_plot_yield(ypr_populations(Rk = c(2.5, 4.6), Llo = c(0, 60))) +
ggplot2::facet_grid(Rk ~ Llo)
## End(Not run)
ypr_plot_yield(ypr_population())
Population Parameters
Description
Generates an object of class ypr_population
.
Usage
ypr_population(
tmax = 20L,
k = 0.15,
Linf = 100,
t0 = 0,
k2 = 0.15,
Linf2 = 100,
L2 = 1000,
Wb = 3,
Ls = 50,
Sp = 100,
es = 1,
Sm = 0,
fb = 1,
tR = 1L,
BH = 1L,
Rk = 3,
n = 0.2,
nL = 0.2,
Ln = 1000,
Lv = 50,
Vp = 100,
Llo = 0,
Lup = 1000,
Nc = 0,
pi = 0.2,
rho = 0,
Hm = 0,
Rmax = 1,
Wa = 0.01,
fa = 1,
q = 0.1,
RPR = 1
)
Arguments
tmax |
The maximum age (yr). |
k |
The VB growth coefficient (yr-1). |
Linf |
The VB mean maximum length (cm). |
t0 |
The (theoretical) age at zero length (yr). |
k2 |
The VB growth coefficient after length L2 (yr-1). |
Linf2 |
The VB mean maximum length after length L2 (cm). |
L2 |
The length (or age if negative) at which growth switches from the first to second phase (cm or yr). |
Wb |
The weight (as a function of length) scaling exponent. |
Ls |
The length (or age if negative) at which 50 % mature (cm or yr). |
Sp |
The maturity (as a function of length) power. |
es |
The annual probability of a mature fish spawning. |
Sm |
The spawning mortality probability. |
fb |
The fecundity (as a function of weight) scaling exponent. |
tR |
The age from which survival is density-independent (yr). |
BH |
Recruitment follows a Beverton-Holt (1) or Ricker (0) relationship. |
Rk |
The lifetime spawners per spawner at low density (or the egg to tR survival if between 0 and 1). |
n |
The annual interval natural mortality rate from age tR. |
nL |
The annual interval natural mortality rate from length Ln. |
Ln |
The length (or age if negative) at which the natural mortality rate switches from n to nL (cm or yr). |
Lv |
The length (or age if negative) at which 50 % vulnerable to harvest (cm or yr). |
Vp |
The vulnerability to harvest (as a function of length) power. |
Llo |
The lower harvest slot length (cm). |
Lup |
The upper harvest slot length (cm). |
Nc |
The slot limits non-compliance probability. |
pi |
The annual capture probability. |
rho |
The release probability. |
Hm |
The hooking mortality probability. |
Rmax |
The number of recruits at the carrying capacity (ind). |
Wa |
The (extrapolated) weight of a 1 cm individual (g). |
fa |
The (theoretical) fecundity of a 1 g female (eggs). |
q |
The catchability (annual probability of capture) for a unit of effort. |
RPR |
The relative proportion of recruits that are of the ecotype. |
Value
An object of class ypr_population
.
Examples
ypr_population(k = 0.1, Linf = 90)
Population Names
Description
Generates set of unique names based on differences in parameter values.
Usage
ypr_population_names(population)
Arguments
population |
An object of class ypr_population, ypr_populations or ypr_ecotypes. |
Value
A character vector of the unique parameter based names.
See Also
Update a Population Object
Description
for
ypr_update()
.
Usage
ypr_population_update(population, ...)
Arguments
population |
A ypr_population object. |
... |
One or more parameter values from |
Populations
Description
Populations
Usage
ypr_populations(..., expand = TRUE, names = NULL)
Arguments
... |
Unused parameters. |
expand |
A flag specifying whether to expand parameter combinations. |
names |
A character vector of unique ecotype names. |
Value
A list of ypr_population()
objects
See Also
Other populations:
as_ypr_populations()
,
chilliwack_bt_05
,
ypr_plot_yield()
,
ypr_populations_expand()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Examples
ypr_populations(Rk = c(2.5, 4.6), Hm = c(0.2, 0.05))
Expand Populations
Description
An object of class ypr_population()
of all unique combinations of parameter
values.
Usage
ypr_populations_expand(populations)
Arguments
populations |
An object of class |
Value
An object of class ypr_population
.
See Also
Other populations:
as_ypr_populations()
,
chilliwack_bt_05
,
ypr_plot_yield()
,
ypr_populations()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Examples
ypr_populations_expand(
ypr_populations(
Rk = c(2.5, 4, 2.5),
Hm = c(0.1, 0.2, 0.1)
)
)
Report
Description
Creates an Rmd file that can be used to generate a report.
Usage
ypr_report(
population,
Ly = 0,
harvest = TRUE,
biomass = FALSE,
title = "Population Report",
description = "",
date = Sys.Date(),
file = "report",
view = FALSE,
ask = TRUE
)
Arguments
population |
An object of class |
Ly |
The minimum length (trophy) fish to consider when calculating the yield (cm). |
harvest |
A flag specifying whether to calculate the yield for harvested fish or captures. |
biomass |
A flag specifying whether to calculate the yield in terms of the biomass versus number of individuals. |
title |
A string of the report title. |
description |
A string describing the population. |
date |
A date of the report date. |
file |
A string of the path to the file (without the extension). |
view |
A flag specifying whether to view the report (after rendering it to html). |
ask |
A flag specifying whether to ask before overwriting or creating a file. |
Value
An invisible character vector of the contents of the file.
See Also
Other tabulate:
ypr_detabulate_parameters()
,
ypr_tabulate_biomass()
,
ypr_tabulate_fish()
,
ypr_tabulate_parameters()
,
ypr_tabulate_schedule()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Examples
## Not run:
ypr_report(ypr_population(), file = tempfile(), ask = FALSE)
## End(Not run)
Life-History Schedule
Description
DEPRECATED: Replace ypr_schedule()
with ypr_tabulate_schedule()
Usage
ypr_schedule(population)
Details
Generates the life-history schedule by age for a population.
Stock-Recruitment Parameters
Description
Returns a single rowed data frame of the SR parameters:
- alpha
Survival from egg to age tR at low density
- beta
Density-dependence
- Rk
Lifetime spawners per spawner at low density
- phi
Lifetime eggs deposited per recruit at unfished equilibrium
- phiF
Lifetime eggs deposited per recruit at the fished equilibrium
- R0
Age tR recruits at the unfished equilibrium
- R0F
Age tR recruits at the fished equilibrium
- S0
Spawners at the unfished equilibrium
- S0F
Spawners at the fished equilibrium
Usage
ypr_sr(object)
Arguments
object |
The population or populations. |
Value
A data frame of the SR parameters.
See Also
Other sr:
ypr_plot_sr()
,
ypr_tabulate_sr()
Examples
ypr_sr(ypr_population()) # Beverton-Holt
ypr_sr(ypr_population(BH = 0L)) # Ricker
Tabulate Biomass (and Eggs)
Description
Produces a data frame of the 'Weight' and 'Fecundity' and the number of 'Survivors' and 'Spawners' and the total 'Biomass' and 'Eggs' by 'Age' class.
Usage
ypr_tabulate_biomass(population)
Arguments
population |
An object of class |
Value
A data frame
See Also
Other tabulate:
ypr_detabulate_parameters()
,
ypr_report()
,
ypr_tabulate_fish()
,
ypr_tabulate_parameters()
,
ypr_tabulate_schedule()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Other biomass:
ypr_plot_biomass()
Examples
ypr_tabulate_biomass(ypr_population())
Tabulate Fish Numbers
Description
Produces a data frame of the number of fish in the 'Survivors', 'Spawners', 'Caught', 'Harvested', 'Released' and 'HandlingMortalities' categories by 'Length', 'Age' or 'Weight' class and 'Ecotype' (NA if not applicable)
Usage
ypr_tabulate_fish(population, x = "Age", binwidth = 1L)
Arguments
population |
An object of class |
x |
The object to coerce. |
binwidth |
A positive integer of the width of the bins for grouping. |
Value
A data frame
See Also
Other tabulate:
ypr_detabulate_parameters()
,
ypr_report()
,
ypr_tabulate_biomass()
,
ypr_tabulate_parameters()
,
ypr_tabulate_schedule()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Other fish:
ypr_plot_fish()
Examples
ypr_tabulate_fish(ypr_population())
Tabulate Population Parameters
Description
Tabulate Population Parameters
Usage
ypr_tabulate_parameters(population)
Arguments
population |
An object of class |
Value
A table of population parameters
See Also
Other tabulate:
ypr_detabulate_parameters()
,
ypr_report()
,
ypr_tabulate_biomass()
,
ypr_tabulate_fish()
,
ypr_tabulate_schedule()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Other parameters:
ypr_detabulate_parameters()
Examples
ypr_tabulate_parameters(ypr_population())
Life-History Schedule
Description
Generates the life-history schedule by age for a population.
Usage
ypr_tabulate_schedule(object, ...)
## S3 method for class 'ypr_population'
ypr_tabulate_schedule(object, ...)
## S3 method for class 'ypr_ecotypes'
ypr_tabulate_schedule(object, ...)
Arguments
object |
The population or populations. |
... |
Unused parameters. |
Value
A tibble of the life-history schedule by age.
Methods (by class)
-
ypr_tabulate_schedule(ypr_population)
: Tabulate Schedule -
ypr_tabulate_schedule(ypr_ecotypes)
: Tabulate Schedule
See Also
Other tabulate:
ypr_detabulate_parameters()
,
ypr_report()
,
ypr_tabulate_biomass()
,
ypr_tabulate_fish()
,
ypr_tabulate_parameters()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Other schedule:
ypr_plot_schedule()
Examples
ypr_tabulate_schedule(ypr_population())
ypr_tabulate_schedule(ypr_ecotypes(Linf = c(10, 20)))
Tabulate Stock-Recruitment Parameters
Description
Tabulate Stock-Recruitment Parameters
Usage
ypr_tabulate_sr(object, ...)
## Default S3 method:
ypr_tabulate_sr(
object,
Ly = 0,
harvest = TRUE,
biomass = FALSE,
all = FALSE,
...
)
## S3 method for class 'ypr_populations'
ypr_tabulate_sr(
object,
Ly = 0,
harvest = TRUE,
biomass = FALSE,
all = FALSE,
...
)
Arguments
object |
The population or populations. |
... |
Unused parameters. |
Ly |
The minimum length (trophy) fish to consider when calculating the yield (cm). |
harvest |
A flag specifying whether to calculate the yield for harvested fish or captures. |
biomass |
A flag specifying whether to calculate the yield in terms of the biomass versus number of individuals. |
all |
A flag specifying whether to include all parameter values. |
Value
A data.frame of stock-recruitment parameters.
Methods (by class)
-
ypr_tabulate_sr(default)
: Tabulate Stock-Recruitment Parameters -
ypr_tabulate_sr(ypr_populations)
: Tabulate Stock-Recruitment Parameters
See Also
Other tabulate:
ypr_detabulate_parameters()
,
ypr_report()
,
ypr_tabulate_biomass()
,
ypr_tabulate_fish()
,
ypr_tabulate_parameters()
,
ypr_tabulate_schedule()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Other populations:
as_ypr_populations()
,
chilliwack_bt_05
,
ypr_plot_yield()
,
ypr_populations_expand()
,
ypr_populations()
,
ypr_tabulate_yields()
,
ypr_tabulate_yield()
Other sr:
ypr_plot_sr()
,
ypr_sr()
Examples
ypr_tabulate_sr(ypr_population()) # Beverton-Holt
ypr_tabulate_sr(ypr_population(BH = 0L)) # Ricker
ypr_tabulate_sr(ypr_populations(Rk = c(2.5, 4.6)))
Tabulate Yield
Description
Tabulate Yield
Usage
ypr_tabulate_yield(object, ...)
## Default S3 method:
ypr_tabulate_yield(
object,
Ly = 0,
harvest = TRUE,
biomass = FALSE,
type = "both",
all = FALSE,
...
)
## S3 method for class 'ypr_populations'
ypr_tabulate_yield(
object,
Ly = 0,
harvest = TRUE,
biomass = FALSE,
type = "both",
all = FALSE,
...
)
Arguments
object |
The population or populations. |
... |
Unused parameters. |
Ly |
The minimum length (trophy) fish to consider when calculating the yield (cm). |
harvest |
A flag specifying whether to calculate the yield for harvested fish or captures. |
biomass |
A flag specifying whether to calculate the yield in terms of the biomass versus number of individuals. |
type |
A string indicating whether to include 'both' or just the 'actual' or 'optimal' yield. |
all |
A flag specifying whether to include all parameter values. |
Value
A data frame.
Methods (by class)
-
ypr_tabulate_yield(default)
: Tabulate Yield -
ypr_tabulate_yield(ypr_populations)
: Tabulate Yield
See Also
Other tabulate:
ypr_detabulate_parameters()
,
ypr_report()
,
ypr_tabulate_biomass()
,
ypr_tabulate_fish()
,
ypr_tabulate_parameters()
,
ypr_tabulate_schedule()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
Other populations:
as_ypr_populations()
,
chilliwack_bt_05
,
ypr_plot_yield()
,
ypr_populations_expand()
,
ypr_populations()
,
ypr_tabulate_sr()
,
ypr_tabulate_yields()
Other yield:
ypr_plot_yield()
,
ypr_yields()
,
ypr_yield()
Examples
ypr_tabulate_yield(ypr_population())
ypr_tabulate_yield(ypr_populations(Rk = c(3, 5)))
Tabulate Yields
Description
Tabulate Yields
Usage
ypr_tabulate_yields(object, ...)
## Default S3 method:
ypr_tabulate_yields(
object,
pi = seq(0, 1, length.out = 100),
Ly = 0,
harvest = TRUE,
biomass = FALSE,
all = FALSE,
...
)
## S3 method for class 'ypr_populations'
ypr_tabulate_yields(
object,
pi = seq(0, 1, length.out = 100),
Ly = 0,
harvest = TRUE,
biomass = FALSE,
all = FALSE,
...
)
Arguments
object |
The population or populations. |
... |
Unused parameters. |
pi |
A vector of probabilities of capture to calculate the yield for. |
Ly |
The minimum length (trophy) fish to consider when calculating the yield (cm). |
harvest |
A flag specifying whether to calculate the yield for harvested fish or captures. |
biomass |
A flag specifying whether to calculate the yield in terms of the biomass versus number of individuals. |
all |
A flag specifying whether to include all parameter values. |
Value
A data frame.
Methods (by class)
-
ypr_tabulate_yields(default)
: Tabulate Yields -
ypr_tabulate_yields(ypr_populations)
: Tabulate Yields
See Also
Other tabulate:
ypr_detabulate_parameters()
,
ypr_report()
,
ypr_tabulate_biomass()
,
ypr_tabulate_fish()
,
ypr_tabulate_parameters()
,
ypr_tabulate_schedule()
,
ypr_tabulate_sr()
,
ypr_tabulate_yield()
Other populations:
as_ypr_populations()
,
chilliwack_bt_05
,
ypr_plot_yield()
,
ypr_populations_expand()
,
ypr_populations()
,
ypr_tabulate_sr()
,
ypr_tabulate_yield()
Examples
ypr_tabulate_yields(ypr_population())
ypr_tabulate_yields(
ypr_populations(
Rk = c(3, 5)
),
pi = seq(0, 1, length.out = 10)
)
ypr_tabulate_yields(ypr_ecotypes(Linf = c(10, 20)))
Update a YPR Object Currently just works with scalar parameters for populations and ecotypes.
Description
Update a YPR Object Currently just works with scalar parameters for populations and ecotypes.
Usage
ypr_update(x, ...)
## S3 method for class 'ypr_population'
ypr_update(x, ...)
## S3 method for class 'ypr_populations'
ypr_update(x, ...)
## S3 method for class 'ypr_ecotypes'
ypr_update(x, ...)
Arguments
x |
A population, populations or ecotypes object to update. |
... |
One or more parameter values from |
Methods (by class)
-
ypr_update(ypr_population)
: Update Population Parameters -
ypr_update(ypr_populations)
: Update Populations Parameters -
ypr_update(ypr_ecotypes)
: Update Populations Parameters
Examples
ypr_update(ypr_population(), Rk = 2.5)
ypr_update(ypr_populations(Rk = c(2.5, 4)), Rk = 2.5)
ypr_update(ypr_ecotypes(Linf = c(2.5, 4)), k = 1.5)
Yield
Description
Calculates the yield for a population.
Usage
ypr_yield(object, Ly = 0, harvest = TRUE, biomass = FALSE, ...)
Arguments
object |
The population or populations. |
Ly |
The minimum length (trophy) fish to consider when calculating the yield (cm). |
harvest |
A flag specifying whether to calculate the yield for harvested fish or captures. |
biomass |
A flag specifying whether to calculate the yield in terms of the biomass versus number of individuals. |
... |
Unused parameters. |
Details
By default, with Rmax = 1
the number of individuals is the proportion of
the recruits at the carrying capacity. If the yield is given in terms of the
biomass (kg) then the scaling also depends on the value of Wa
(g).
Value
The yield as number of fish or biomass.
See Also
Other yield:
ypr_plot_yield()
,
ypr_tabulate_yield()
,
ypr_yields()
Other calculate:
ypr_age_at_length()
,
ypr_exploitation()
,
ypr_length_at_age()
,
ypr_optimize()
,
ypr_yields()
Examples
ypr_yield(ypr_population())
ypr_yield(ypr_ecotypes(Linf = c(100, 200)))
Yields
Description
Calculates the yield(s) for a population based on one or more capture rates.
Usage
ypr_yields(
object,
pi = seq(0, 1, length.out = 100),
Ly = 0,
harvest = TRUE,
biomass = FALSE
)
Arguments
object |
The population or populations. |
pi |
A vector of probabilities of capture to calculate the yield for. |
Ly |
The minimum length (trophy) fish to consider when calculating the yield (cm). |
harvest |
A flag specifying whether to calculate the yield for harvested fish or captures. |
biomass |
A flag specifying whether to calculate the yield in terms of the biomass versus number of individuals. |
Value
A numeric vector of the yields.
See Also
Other yield:
ypr_plot_yield()
,
ypr_tabulate_yield()
,
ypr_yield()
Other calculate:
ypr_age_at_length()
,
ypr_exploitation()
,
ypr_length_at_age()
,
ypr_optimize()
,
ypr_yield()
Examples
pi <- seq(0, 1, length.out = 30)
plot(pi, ypr_yields(ypr_population(), pi), type = "l")