model_weight | R Documentation |
model_weight
estimates a and b parameter from length and weight observations.
model_weight(data_weight, a = 0.05, b = 2.5)
data_weight |
data with weight and size vectors |
a |
initialisation of a (set at 0.05) |
b |
initialisation of b (set at 2.5) |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.