ConvertLength: Converts Total Length to Fork Length or Fork Length to Total...

Description Usage Arguments Value Note References Examples

View source: R/clean_length.R

Description

Mostly this function applies to California-based sturgeon and mostly because in 2013 regulations changed from total length to fork length (cm). The CDFW now measures fork length, so this function facilitates conversion between years allowing for more consistent analytics.

Usage

1
ConvertLength(data, tl, fl, sp, convertTo = c("TL", "FL"))

Arguments

data

Dataframe containing (at least) length (fork & total) & species.

tl

Field name (not quoted) in data that holds total length.

fl

Field name (not quoted) in data that holds fork length.

sp

Field name (not quoted) in data that holds species.

convertTo

Character scalar option of either "TL" or "FL", the length type converting to.

Value

A numeric vector with length = nrow(data) where data are total length or fork length per choice in convertTo. Where converting to length already exists, that length it used rather than converting. If both TL & FL are NA, then returned length is also NA.

Note

Conversions use linear regression models (one for White Sturgeon another for Green Sturgeon). See References for source of models.

FL_{WST}=-1.2162 + (0.9036 * TL_{WST})

TL_{GST}=-4.6131 + (1.1374 * FL_{GST})

References

coming soon for equations

Examples

1
# coming soon

jasondubois/sportfish documentation built on July 3, 2020, 1:01 p.m.