model_weight: Weight size relationship

View source: R/model_weight.R

model_weightR Documentation

Weight size relationship

Description

model_weight estimates a and b parameter from length and weight observations.

Usage

model_weight(data_weight, a = 0.05, b = 2.5)

Arguments

data_weight

data with weight and size vectors

a

initialisation of a (set at 0.05)

b

initialisation of b (set at 2.5)

Examples

 df_wg_size = data_frame(length = seq(from = 0, to = 50, by = 0.5)) %>% mutate(weight = 0.015*(length^3.2))
 weight <- NULL
 length <- NULL
 l <- 0
 for (k in df_wg_size$weight) {
 weight <- c(weight, rnorm(10, k, k/10))
 length <- c(length, rep(l, 10))
 l <- l + 0.5}
 df_size <- data_frame(length, weight)
 plot(df_size)
 model_weight(df_size)

polehalieutique/demerstem documentation built on Aug. 4, 2024, 5:12 a.m.