fit_mat_ogive | R Documentation |
Fit and plot maturity ogives
fit_mat_ogive(
dat,
type = c("age", "length"),
sample_id_re = FALSE,
year_re = FALSE,
months = seq(1, 12),
custom_maturity_at = NULL,
ageing_method_codes = NULL,
usability_codes = c(0, 1, 2, 6),
link = c("logit", "probit", "cloglog", "cauchit", "log")
)
plot_mat_ogive(
object,
col = c(M = "grey50", F = "black"),
xlab = if (object$type[[1]] == "age") "Age (years)" else "Length (cm)",
title = if (object$type[[1]] == "age") "Age at maturity" else "Length at maturity",
rug = TRUE,
rug_n = 1500,
x_max = 1.75,
prediction_type = c("all", "male", "female", "none"),
text_label_size = 3,
show_quant_text = TRUE,
french = FALSE
)
plot_mat_annual_ogives(
object,
xlab = if (object$type[[1]] == "age") "Age (years)" else "Length (cm)",
title = if (object$type[[1]] == "age") "Age at maturity" else "Length at maturity",
rug = TRUE,
rug_n = 1500,
x_max = 1.75,
prediction_type = c("all", "male", "female", "none"),
french = FALSE
)
dat |
Data from |
type |
Should this be an age or length fit? |
sample_id_re |
If |
year_re |
If |
months |
A numeric vector indicating which months to include when fitting the maturity ogive. Defaults to all months. |
custom_maturity_at |
A numeric vector of two threshold codes to define
maturity at with the first being for males and the second for females.
Defaults to |
ageing_method_codes |
A numeric vector of ageing method codes to filter
on. Defaults to |
usability_codes |
An optional vector of usability codes.
All usability codes not in this vector will be omitted.
Set to |
link |
The link function for the binomial GLM (by default, |
object |
Output from |
col |
A named character vector declaring the colors for F and M. |
xlab |
X axis label. |
title |
Title for the plot. |
rug |
Logical indicating whether rug lines should be added. |
rug_n |
The number of rug lines to sample from the total number of fish. |
x_max |
Used in determining the right axis limit. |
prediction_type |
The prediction lines to show. Useful if you only want to show model fits when you have sufficient data. |
text_label_size |
Font size for the labels showing the age-at- values for either age or length on the plot panel |
show_quant_text |
Logical. If |
french |
Translate to French? |
# d <- gfdata::get_survey_samples("pacific ocean perch", ssid = 1)
d <- pop_samples
m <- fit_mat_ogive(d, type = "age", sample_id_re = FALSE)
plot_mat_ogive(m)
m <- fit_mat_ogive(d, type = "length", sample_id_re = FALSE)
plot_mat_ogive(m)
## Not run:
## with random intercepts for sample ID:
m <- fit_mat_ogive(d, type = "length", sample_id_re = TRUE)
plot_mat_ogive(m)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.