
Plot age-length relationships and growth curves
plot_growth(
dt,
length = "length",
age = "age",
sex = "sex",
female.sex = "F",
male.sex = "M",
length.unit = "cm",
split.by.sex = FALSE,
growth.model = 1,
force.zero.group.length = NA,
force.zero.group.strength = 10,
force.zero.group.cv = 0,
show.Linf = TRUE,
boxplot = TRUE,
base_size = 8,
legend.position = "bottom"
)
A list containing the plot
, text
for Rmarkdown and Shiny applications, and estimated parameters (params
).
A data.frame, tibble or data.table
Character argument giving the name of the length column in dt
Character argument giving the name of the age column in dt
Character argument giving the name of the sex column in dt
. Ignored if split.by.sex == FALSE
.
A character or integer denoting female and male sex in the sex
column of dt
, respectively.
A character argument giving the unit of length
. Will be used in the labels of the figure.
Logical indicating whether the result should be split by sex.
Integer defining the growth model. 1 = von Bertalanffy, 2 = Gompertz, 3 = Logistic.
Numeric indicating the length to which 0-group should be forced. Use NA
ignore the forcing.
Numeric indicating how many percent of total fish should be added to the specified force.zero.group.length
.
Numeric indicating the coefficient of variation for the forced 0-group length. Resulting lengths will be randomly generated from a normal distribution.
Logical indicating whether Linf values should be shown as dashed vertical lines.
Logical indicating whether boxplots (TRUE
) should be used to show data over points (FALSE
)
Base size parameter for ggplot. See ggtheme.
Position of the ggplot legend as a character. See ggtheme.
Mikko Vihtakari // Institute of Marine Research.
Uses the fishmethods::growth
function to calculate the growth curves. Zero group length can be forced to the growth functions using the force.zero.group.*
parameters.
# Simple plot. Note that a list is returned.
data(survey_ghl)
plot_growth(survey_ghl, length = "length", age = "age")
# \donttest{
# Split by sex
plot_growth(survey_ghl, split.by.sex = TRUE)$plot
# Data as points. Forcing zero group to 10 cm
plot_growth(survey_ghl, force.zero.group.length = 10, boxplot = FALSE)$plot
# }
Run the code above in your browser using DataLab