Skip to contents

Returns a vector that contains all known or a subset of information about the standard weight equation for a given species, type of measurement units, and reference percentile.

Usage

wsVal(
  species = "List",
  group = NULL,
  units = c("metric", "English"),
  ref = NULL,
  method = NULL,
  simplify = FALSE
)

Arguments

species

A string that contains the species name for which to find Ws coefficients. See details.

group

A string that contains the sub-group of `species` for which to find the Ws coefficients. Will be things like “"lotic"”, “"lentic"”, “"female"”, “"male"”, etc.

units

A string that indicates whether the coefficients for the standard weight equation to be returned are in ("metric" (DEFAULT; mm and g) or "English" (in and lbs) units.

ref

A numeric that indicates which percentile the equation should be returned for. Note that the vast majority of equations only exist for the 75th percentile (DEFAULT).

method

A string that indicates which equation-derivation method should be used (one of `RLP`, `EmP`, or `Other`). Defaults to `NULL` which will result in the only method available being returned or an error asking the user to choose a method equations from more than one method are available (which is the case for very few species).

simplify

A logical that indicates whether the ‘units’, ‘ref’, ‘measure’, ‘method’, ‘comments’, and ‘source’ fields should be included (=FALSE) or not (=TRUE; DEFAULT). See details.

Value

A one row data frame from WSlit that contains all known information about the standard weight equation for a given species, type of measurement units, and reference percentile if simplify=FALSE. If simplify=TRUE then only the species; minimum and maximum length for which the standard equation should be applied; and intercept, slope, and quadratic coefficients for the standard weight equation. Note that the maximum length and the quadratic coefficient will not be returned if they do not exist in WSlit.

If no arguments are given to this function, a species name is mis-spelled, or if a standard weight equation does not exist (in WSlit) for a particular species, then a warning will be issued and a list of species names will be printed.

Details

This function extract all known information from WSlit about the following standard weight equation,

$$log_{10}(Ws) = log_{10}(a) + blog_{10}(L) + blog_{10}(L)^{2}$$

See WSlit for more information about the meaning of each value returned.

Note from above that the coefficients are returned for the TRANSFORMED model. Thus, to obtain the standard weight (Ws), the returned coefficients are used to compute the common log of Ws which must then bed raised to the power of 10 to compute the Ws.

IFAR Chapter

8-Condition.

References

Ogle, D.H. 2016. Introductory Fisheries Analyses with R. Chapman & Hall/CRC, Boca Raton, FL.

See also

See wrAdd and WSlit for related functionality.

Author

Derek H. Ogle, DerekOgle51@gmail.com

Examples

#===== List all available Ws equations
wsVal()
#> 
#> Species name must be one of following. Be careful of spelling and capitalization.
#>   [1] "Aegean Chub"                "African Sharptooth Catfish"
#>   [3] "Alabama Bass"               "Ankara Nase"               
#>   [5] "Arctic Grayling"            "Bighead Carp"              
#>   [7] "Bigmouth Buffalo"           "Bigmouth Sleepers"         
#>   [9] "Black Bullhead"             "Black Crappie"             
#>  [11] "Blacktail Redhorse"         "Blue Catfish"              
#>  [13] "Blue Sucker"                "Bluegill"                  
#>  [15] "Bridgelip Sucker"           "Brook Chub"                
#>  [17] "Brook Trout"                "Brown Bullhead"            
#>  [19] "Brown Trout"                "Bull Trout"                
#>  [21] "Burbot"                     "Cavedano Chub"             
#>  [23] "Chain Pickerel"             "Channel Catfish"           
#>  [25] "Chinook Salmon"             "Cisco"                     
#>  [27] "Common Carp"                "Cutthroat Trout"           
#>  [29] "European Chub"              "European Perch"            
#>  [31] "Flannelmouth Sucker"        "Flathead Catfish"          
#>  [33] "Fourbarbel Scraper"         "Freshwater Drum"           
#>  [35] "Gizzard Shad"               "Golden Shiner"             
#>  [37] "Golden Trout"               "Goldeye"                   
#>  [39] "Green Sunfish"              "Horse Barbel"              
#>  [41] "Humpback Chub"              "Kokanee"                   
#>  [43] "Lake Chubsucker"            "Lake Herring"              
#>  [45] "Lake Trout"                 "Largemouth Bass"           
#>  [47] "Largescale Sucker"          "Longnose Gar"              
#>  [49] "Marble Trout"               "Mountain Mullet"           
#>  [51] "Mountain Whitefish"         "Muskellunge"               
#>  [53] "Nile Tilapia"               "Nipple-Lip Scraper"        
#>  [55] "Northern Pike"              "Northern Pikeminnow"       
#>  [57] "Northern Snakehead"         "Northern Squawfish"        
#>  [59] "Paddlefish"                 "Palmetto Bass"             
#>  [61] "Pejerrey"                   "Pumpkinseed"               
#>  [63] "Pursak Chub"                "Rainbow Trout"             
#>  [65] "Razorback Sucker"           "Redbreast Sunfish"         
#>  [67] "Redear Sunfish"             "Riffle Dace"               
#>  [69] "River Carpsucker"           "River Goby"                
#>  [71] "Rock Bass"                  "Roundtail Chub"            
#>  [73] "Ruffe"                      "Sardine"                   
#>  [75] "Sauger"                     "Saugeye"                   
#>  [77] "Shoal Bass"                 "Shorthead Redhorse"        
#>  [79] "Shovelnose Sturgeon"        "Silver Carp"               
#>  [81] "Smallmouth Bass"            "Smallmouth Buffalo"        
#>  [83] "South European Roach"       "Spotted Bass"              
#>  [85] "Spotted Gar"                "Spotted Sunfish"           
#>  [87] "Striped Bass"               "Striped Bass X White Bass" 
#>  [89] "Suwannee Bass"              "Tiger Muskellunge"         
#>  [91] "Utah Chub"                  "Walleye"                   
#>  [93] "Warmouth"                   "White Bass"                
#>  [95] "White Catfish"              "White Crappie"             
#>  [97] "White Perch"                "White Sturgeon"            
#>  [99] "White Sucker"               "Yellow Bass"               
#> [101] "Yellow Bullhead"            "Yellow Perch"              

#===== Find equations for Bluegill, in different formats
wsVal("Bluegill")
#>     species measure  units ref method min.TL    int slope         source
#> 26 Bluegill      TL metric  75  Other     80 -5.374 3.316 Hillman (1982)
wsVal("Bluegill",units="metric")
#>     species measure  units ref method min.TL    int slope         source
#> 26 Bluegill      TL metric  75  Other     80 -5.374 3.316 Hillman (1982)
wsVal("Bluegill",units="English")
#>     species measure   units ref method min.TL    int slope         source
#> 25 Bluegill      TL English  75  Other      3 -3.371 3.316 Hillman (1982)
wsVal("Bluegill",units="English",simplify=TRUE)
#>     species min.TL    int slope
#> 25 Bluegill      3 -3.371 3.316

#===== Find equation for Cutthroat Trout, demonstration group
wsVal("Cutthroat Trout",group="lotic")
#>            species group measure  units ref method min.TL    int slope
#> 57 Cutthroat Trout lotic      TL metric  75    RLP    130 -5.189 3.099
#>                     source
#> 57 Kruse and Hubert (1997)
wsVal("Cutthroat Trout",group="lentic")
#>            species  group measure  units ref method min.TL    int slope
#> 55 Cutthroat Trout lentic      TL metric  75    RLP    130 -5.192 3.086
#>                     source
#> 55 Kruse and Hubert (1997)

#===== Find equation for Ruffe, demonstration quadratic formula
wsVal("Ruffe",units="metric",ref=75,simplify=TRUE)
#>     species min.TL max.TL   int slope   quad
#> 148   Ruffe     55    205 -2.58 0.621 0.6073
wsVal("Ruffe",units="metric",ref=50,simplify=TRUE)
#>     species min.TL max.TL     int  slope   quad
#> 147   Ruffe     55    205 -3.3524 1.3969 0.4054

#===== Add Ws & Wr values to a data frame (for one species) ... also see wrAdd()
#----- Get Ws equation info
wsBG <- wsVal("Bluegill",units="metric")
wsBG
#>     species measure  units ref method min.TL    int slope         source
#> 26 Bluegill      TL metric  75  Other     80 -5.374 3.316 Hillman (1982)
#----- Get example data
data(BluegillLM,package="FSAdata")
str(BluegillLM)
#> 'data.frame':	100 obs. of  5 variables:
#>  $ sernum: int  100 110 120 130 140 150 160 170 180 190 ...
#>  $ sl    : int  126 124 118 136 191 121 105 123 123 120 ...
#>  $ fl    : int  152 150 140 163 144 149 128 151 148 148 ...
#>  $ tl    : int  157 153 149 172 150 155 134 157 155 154 ...
#>  $ wght  : int  92 88 77 130 86 90 53 90 79 83 ...
#----- Add Ws (eqn is on log10-log10 scale ... so log10 len, 10^ result)
BluegillLM$ws <- 10^(wsBG[["int"]]+wsBG[["slope"]]*log10(BluegillLM$tl))
#----- Change Ws for fish less than min.TL to NA
BluegillLM$ws[BluegillLM$tl<wsBG[["min.TL"]]] <- NA
#----- Add Wr
BluegillLM$wr <- BluegillLM$wght/BluegillLM$ws*100
#----- Examine results
peek(BluegillLM,n=6)
#>     sernum  sl  fl  tl wght        ws        wr
#> 1      100 126 152 157   92  80.83571 113.81109
#> 20     290 124 148 153   86  74.20562 115.89419
#> 40     490 169 201 210  236 212.06997 111.28402
#> 60     690 175 215 221  277 251.19141 110.27447
#> 80     890  90 110 115   27  28.79215  93.77557
#> 100   1090 105 128 133   49  46.63286 105.07612

#----- Same as above but using dplyr
data(BluegillLM,package="FSAdata")   # reset to original for this example
if (require(dplyr)) {
  BluegillLM <- BluegillLM %>%
    mutate(ws=10^(wsBG[["int"]]+wsBG[["slope"]]*log10(tl)),
           ws=ifelse(tl<wsBG[["min.TL"]],NA,ws),
           wr=wght/ws*100)
  peek(BluegillLM,n=6)
}
#>     sernum  sl  fl  tl wght        ws        wr
#> 1      100 126 152 157   92  80.83571 113.81109
#> 20     290 124 148 153   86  74.20562 115.89419
#> 40     490 169 201 210  236 212.06997 111.28402
#> 60     690 175 215 221  277 251.19141 110.27447
#> 80     890  90 110 115   27  28.79215  93.77557
#> 100   1090 105 128 133   49  46.63286 105.07612