-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
621 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
^README\.md | ||
^\.travis\.yml$ | ||
^appveyor\.yml$ | ||
^data-raw$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#' @title Standard intercepts for Fraser-Lee model by species. | ||
#' | ||
#' @description Standard intercepts (in mm) for Fraser-Lee model for all species for which the standard has been defined. | ||
#' | ||
#' @format A data frame with 1 rows and 3 variables: | ||
#' \describe{ | ||
#' \item{species}{Fish species.} | ||
#' \item{a}{Standard intercept value (in mm).} | ||
#' \item{source}{Source of the standard.} | ||
#' } | ||
#' | ||
#' @references Beck, H.D., D.W. Willis, and J.M. Francis. 1997. A proposed standard intercept for the White Bass body length-scale relationship. North American Journal of Fisheries Management 32:239-248. | ||
#' | ||
#' Carlander, K.D. 1982. Standard intercepts for calculating lengths from scale measurements for some centrarchid and percid fishes. Transactions of the American Fisheries Society 111:333-336. | ||
#' | ||
#' @seealso \code{\link{aStandard}} | ||
"StdIntLit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#' @title Finds standard intercept (a) for Fraser-Lee back-calculation model for a particular species. | ||
#' | ||
#' @description Finds standard intercept (a; mm) for Fraser-Lee back-calculation model for a particular species for all species for which a value of a has been defined. | ||
#' | ||
#' @param species A string that contains the species name for which to find teh standard intercept value. | ||
#' @return A single value from \code{\link{StdIntLit}} that is the standard intercept value (a; mm) for the species provided in \code{species}. | ||
#' | ||
#' @author Derek H. Ogle, \email{derek@@derekogle.com} | ||
#' | ||
#' @seealso \code{\link{StdIntLit}} | ||
#' | ||
#' @keywords manip | ||
#' | ||
#' @examples | ||
#' aStandard("Bluegill") | ||
#' aStandard("Walleye") | ||
#' | ||
#' @export | ||
aStandard <- function(species) { | ||
# Load StdIntLit data frame into this function's environment. The data/get | ||
# combination are used to avoide the "no global binding" note at CHECK | ||
StdIntLit <- get(utils::data("StdIntLit",envir=environment()),envir=environment()) | ||
# Check species | ||
if (missing(species)) STOP("'species' must be one of: ", | ||
paste(StdIntLit$species,collapse=", ")) | ||
species <- FSA::capFirst(species) | ||
if (length(species)>1) STOP("Can have only one name in 'species'.") | ||
if (!species %in% StdIntLit$species) STOP("'species' must be one of: ", | ||
paste(StdIntLit$species,collapse=", ")) | ||
# Return a for that species | ||
StdIntLit$a[StdIntLit==species] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
StdIntLit <- read.csv("data-raw/StdIntLit.csv",stringsAsFactors=FALSE) | ||
str(StdIntLit) | ||
save(StdIntLit,file="data/StdIntLit.RData") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
species,a,source | ||
Black Crappie,35,Carlander (1982) | ||
Bluegill,20,Carlander (1982) | ||
Green Sunfish,10,Carlander (1982) | ||
Largemouth Bass,20,Carlander (1982) | ||
Pumpkinseed,25,Carlander (1982) | ||
Rock Bass,25,Carlander (1982) | ||
Smallmouth Bass,35,Carlander (1982) | ||
Walleye,55,Carlander (1982) | ||
Warmouth,20,Carlander (1982) | ||
White Bass,40,Beck et al. (1997) | ||
White Crappie,35,Carlander (1982) | ||
Yellow Perch,30,Carlander (1982) |
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.