fitWL | R Documentation |
Fit weight-length relationship
fitWL(df, colname.weight = "Weight", colname.length = "Length",
plotFit = FALSE, mindata = 0, ...)
df |
|
colname.weight |
chr, the name of the column containing weight data. Only used if df is |
colname.length |
chr, the name of the column containing length data. Only used if df is |
plotFit |
logical, if TRUE plot the fitted line along with the input data |
mindata |
integer, the minumum data points. If less data are available, default paramter values are returned with a warning. |
... |
additional arguments passed to plot |
A list with a and b parameters and data points used (n)
fitWL
return an error if data from more than one species are contained in the DATRASraw object.
If mindata is 4 or lower the minimum acceptable amount of data points is set to 4.
## Simulated data
a <- 0.00058
b <- 3.123
df <- data.frame(lengths = 50:100, weights = a * c(50:100) ^ b + rnorm(51))
## Fit weight-length relationship and compare with simulated values of a and b
s6model:::fitWL(df, colname.weight = "we", colname.length = "le")
## a: 0.00057 (sim: 0.00058)
## b: 3.128 (sim: 3.123)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.