diff --git a/DESCRIPTION b/DESCRIPTION index 67622948..3d1020a6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: FSA -Version: 0.8.30.9000 -Date: 2020-5-27 +Version: 0.8.31 +Date: 2020-11-7 Title: Simple Fisheries Stock Assessment Methods Description: A variety of simple fish stock assessment methods. Detailed vignettes are available on the fishR website . @@ -42,7 +42,8 @@ Suggests: pkgdown, psych, Rcapture, + rmarkdown, testthat, - rmarkdown + tibble Encoding: UTF-8 RoxygenNote: 7.1.1 diff --git a/NEWS.md b/NEWS.md index 95f1dbff..b02b4f44 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,9 @@ -# FSA 0.8.31 ongoing +# FSA 0.8.31 7-Nov20 * Now using roxygen v7.1.1. +* Added `tibble` to suggests (see comment about `headtail()` below). * Cleaned up the documentation of parameters for `RichardsFuns()` (documentation did not change when parameter letters were changed for the Age and Growth book). +* Changed example in `headtail()` to use `as_tibble()` from `tibble` package rather than `tbl_df()` from `dplyr` package. Required adding `tibble` to suggests. +* `nlsTracePlot()`: Modified. Created a conditional catch depending on the version of R as the results of `nls(*,trace=TRUE)` are changing in v4.1.0 (per e-mail from Martin Maechler on 2-Nov-20). # FSA 0.8.30 9-Mar-20 * Started using `rhub::check_for_cran()` for checking before sending to CRAN. @@ -1033,7 +1036,7 @@ # FSA 0.4.11 May14 * Removed Roxygen directives in DESCRIPTION (with changes to roxygen2 4.0.1). -* Changed `@S3method` and `@method` to `@export` in the following files according to changes in ROxygen2 as [described here](http://stackoverflow.com/questions/7198758/roxygen2-how-to-properly-document-s3-methods/7199577#7199577), among several other places: `ageBias`, `agePrecision`, `bootCase`, `catchCurve`, `chapmanRobson`, `confint.nlsboot`, `depletion`, `dietOverlap`, `fitPlot`, `hist.formula`, `htest.nlsBoot`, `ks2d1`, `ks2d1p`, `ks2d2`, `ks2d2p`, `ksTest`, `lencat`, `mrClosed`, `mrOpen`, `plotBinResp`, `predict.nlsBoot`, `removal`, `residPlot`, `srStarts`, `Subset`, `Summarize`, `sumTable`, `vbStarts`, and `walfordChapmanPlot`. +* Changed `@S3method` and `@method` to `@export` in the following files according to changes in ROxygen2 as [described here](https://stackoverflow.com/questions/7198758/roxygen2-how-to-properly-document-s3-methods/7199577/), among several other places: `ageBias`, `agePrecision`, `bootCase`, `catchCurve`, `chapmanRobson`, `confint.nlsboot`, `depletion`, `dietOverlap`, `fitPlot`, `hist.formula`, `htest.nlsBoot`, `ks2d1`, `ks2d1p`, `ks2d2`, `ks2d2p`, `ksTest`, `lencat`, `mrClosed`, `mrOpen`, `plotBinResp`, `predict.nlsBoot`, `removal`, `residPlot`, `srStarts`, `Subset`, `Summarize`, `sumTable`, `vbStarts`, and `walfordChapmanPlot`. * `addZeroCatch()`: Modified. Added a catch for the situation where no zeros need to be added to the data.frame. Cleaned-up the help file, modified the examples, and added another example. Thanks to Ben Neely for bringing this bug (handling where zeros are not needed) to my attention. * `capHistSum()`: Modified. Cleaned up the code (no changes in functionality). diff --git a/R/FSA.R b/R/FSA.R index cb997b8a..de0302d8 100644 --- a/R/FSA.R +++ b/R/FSA.R @@ -4,16 +4,16 @@ #' #' @details Functions from this package can be used to perform a variety of basic fisheries stock assessment methods. Detailed descriptions for most functions are available in the \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analysis with R} book (Ogle 2016). Vignettes for the boxed examples in the \dQuote{Analysis and Interpretation of Freshwater Fisheries Data} book can be viewed with \code{fishR("AIFFD")}. #' -#' Questions, comments, or suggestions should be given on the \href{https://github.com/droglenc/FSA/issues}{GitHub FSA Issues page}. +#' Questions, comments, or suggestions should be given on the \href{https://github.com/droglenc/FSA/issues/}{GitHub FSA Issues page}. #' #' Packages with related functionality by the same author are #' \itemize{ -#' \item The \href{https://github.com/droglenc/FSAdata}{FSAdata package} contains additional data sets. -#' \item The \href{https://github.com/droglenc/FSAsim}{FSAsim package} simulation routines for various fisheries methods. -#' \item The \href{https://github.com/droglenc/FSAWs}{FSAWs package} contains functions for developing and validating standard weight equations. +#' \item The \href{https://github.com/droglenc/FSAdata/}{FSAdata package} contains additional data sets. +#' \item The \href{https://github.com/droglenc/FSAsim/}{FSAsim package} simulation routines for various fisheries methods. +#' \item The \href{https://github.com/droglenc/FSAWs/}{FSAWs package} contains functions for developing and validating standard weight equations. #' } #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @docType package #' diff --git a/R/FSAUtils.R b/R/FSAUtils.R index 4cc013b5..462742ff 100644 --- a/R/FSAUtils.R +++ b/R/FSAUtils.R @@ -186,7 +186,7 @@ col2rgbt <- function(col,transp=1) { #' #' @return A data.frame with one variable that contains the values from the chosen diagonal of \code{x} and, optionally, a second variable that contains the chosen labels for those values. #' -#' @author Derek H. Ogle, \email{derek@@derekogle.com}, but relied heavily on \url{http://stackoverflow.com/a/27935808/1123933}. +#' @author Derek H. Ogle, \email{derek@@derekogle.com}, but relied heavily on \url{https://stackoverflow.com/a/27935808/1123933/}. #' #' @keywords manip #' @@ -235,7 +235,7 @@ diags <- function(x,which=0,incl.labels=c("none","row","column"), if (nrow(x)==1 | ncol(x)==1) STOP("'x' must have more than 1 row and more than 1 column.") ## find indices of diagonals for the matrix - ## idea from http://stackoverflow.com/a/27935808/1123933 + ## idea from https://stackoverflow.com/a/27935808/1123933/ ind <- row(x)-col(x) if (is.null(which)) { # nocov start ## Simply show the matrix of indices @@ -421,14 +421,14 @@ FSANews <- function () { #' headtail(miris,addrownums=FALSE) #' headtail(miris,10,which=2:4) #' -#' ## Make a tbl_df type from dplyr ... note how headtail() +#' ## Make a tbl_df type from tibble ... note how headtail() #' ## is not limited by the tbl_df restriction on number of #' ## rows to show (but head() is). -#' if (require(dplyr)) { -#' iris2 <- tbl_df(iris) +#' if (require(tibble)) { +#' iris2 <- as_tibble(iris) #' class(iris2) #' headtail(iris2,n=15) -#' head(iris2,n=30) +#' head(iris2,n=15) #' } #' @export headtail <- function(x,n=3L,which=NULL,addrownums=TRUE,...) { diff --git a/R/PSDlit.R b/R/PSDlit.R index 60dbf2b9..6833dbab 100644 --- a/R/PSDlit.R +++ b/R/PSDlit.R @@ -36,7 +36,7 @@ #' #' @seealso See \code{\link{psdVal}}, \code{\link{psdCalc}}, \code{\link{psdPlot}}, \code{\link{psdAdd}}, and \code{\link{tictactoe}} for related functionality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @source Original summary table from Dr. Michael Hansen, University of Wisconsin-Stevens Point. Additional species have been added by the package author from the literature. #' diff --git a/R/WSlit.R b/R/WSlit.R index 74120ae4..3964b37f 100644 --- a/R/WSlit.R +++ b/R/WSlit.R @@ -40,7 +40,7 @@ #' #' @section IFAR Chapter: 8-Condition. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @source Most of these equations can be found in Neumann, R.M., C.S. Guy, and D.W. Willis. 2012. Length, Weight, and Associated Indices. Chapter 14 in Zale, A.V., D.L. Parrish, and T.M. Sutton, editors. Fisheries Techniques. American Fisheries Society, Bethesda, MD. #' diff --git a/R/addZeroCatch.R b/R/addZeroCatch.R index fd31d774..93b41016 100644 --- a/R/addZeroCatch.R +++ b/R/addZeroCatch.R @@ -25,7 +25,7 @@ #' #' @seealso \code{complete} in \pkg{tidyr} package. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @keywords manip #' diff --git a/R/ageComparisons.R b/R/ageComparisons.R index ce33767d..3e60bd5f 100644 --- a/R/ageComparisons.R +++ b/R/ageComparisons.R @@ -19,10 +19,10 @@ #' \item R Number of age estimates given in \code{formula}. #' \item PercAgree The percentage of fish for which all age estimates perfectly agree. #' \item ASD The average (across all fish) standard deviation of ages within a fish. -#' \item ACV The average (across all fish) coefficient of variation of ages within a fish using the \bold{mean} as the divisor. See the \href{http://derekogle.com/IFAR}{IFAR chapter} for calculation details. +#' \item ACV The average (across all fish) coefficient of variation of ages within a fish using the \bold{mean} as the divisor. See the \href{http://derekogle.com/IFAR/}{IFAR chapter} for calculation details. #' \item ACV2 The average (across all fish) coefficient of variation of ages within a fish using the \bold{median} as the divisor. This will only be shown if R>2 or \code{show.prec2=TRUE}. #' \item AAD The average (across all fish) absolute deviation of ages within a fish. -#' \item APE The average (across all fish) percent error of ages within a fish using the \bold{mean} as the divisor. See the \href{http://derekogle.com/IFAR}{IFAR chapter} for calculation details. +#' \item APE The average (across all fish) percent error of ages within a fish using the \bold{mean} as the divisor. See the \href{http://derekogle.com/IFAR/}{IFAR chapter} for calculation details. #' \item APE2 The average (across all fish) percent error of ages within a fish using the \bold{median} as the divisor. This will only be shown if R>2 or \code{show.prec2=TRUE}. #' \item AD The average (across all fish) index of precision (D). #' } @@ -63,7 +63,7 @@ #' #' @seealso See \code{\link{ageBias}} for computation of the full age agreement table, along with tests and plots of age bias. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Beamish, R.J. and D.A. Fournier. 1981. A method for comparing the precision of a set of age determinations. Canadian Journal of Fisheries and Aquatic Sciences 38:982-983. [Was (is?) available from http://www.pac.dfo-mpo.gc.ca/science/people-gens/beamish/PDF_files/compareagecjfas1981.pdf.] #' @@ -420,7 +420,7 @@ summary.agePrec <- function(object,what=c("precision","difference", #' #' @section IFAR Chapter: 4-Age Comparisons. \bold{Note that \code{plot} has changed since IFAR was published. Some of the original functionality is in \code{\link{plotAB}}.} #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Campana, S.E., M.C. Annand, and J.I. McMillan. 1995. Graphical and statistical methods for determining the consistency of age determinations. Transactions of the American Fisheries Society 124:131-138. [Was (is?) available from http://www.bio.gc.ca/otoliths/documents/Campana\%20et\%20al\%201995\%20TAFS.pdf.] #' diff --git a/R/alkIndivAge.R b/R/alkIndivAge.R index 3d5eea64..32ca799c 100644 --- a/R/alkIndivAge.R +++ b/R/alkIndivAge.R @@ -13,7 +13,7 @@ #' @param key A numeric matrix that contains the age-length key. The format of this matrix is important. See details. #' @param formula A formula of the form \code{age~length} where \code{age} generically represents the variable that will contain the estimated ages once the key is applied (i.e., should currently contain no values) and \code{length} generically represents the variable that contains the known length measurements. If only \code{~length} is used, then a new variable called \dQuote{age} will be created in the resulting data frame. #' @param data A data.frame that minimally contains the length measurements and possibly contains a variable that will receive the age assignments as given in \code{formula}. -#' @param type A string that indicates whether to use the semi-random (\code{type="SR"}, default) or completely-random (\code{type="CR"}) methods for assigning ages to individual fish. See the \href{http://derekogle.com/IFAR}{IFAR chapter} for more details. +#' @param type A string that indicates whether to use the semi-random (\code{type="SR"}, default) or completely-random (\code{type="CR"}) methods for assigning ages to individual fish. See the \href{http://derekogle.com/IFAR/}{IFAR chapter} for more details. #' @param breaks A numeric vector of lower values that define the length intervals. See details. #' @param seed A single numeric that is given to \code{set.seed} to set the random seed. This allows repeatability of results. #' @@ -27,7 +27,7 @@ #' #' @seealso See \code{\link{alkAgeDist}} and \code{\link{alkMeanVar}} for alternative methods to derived age distributions and mean (and SD) values for each age. See \code{\link{alkPlot}} for methods to visualize age-length keys. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Isermann, D.A. and C.T. Knight. 2005. A computer program for age-length keys incorporating age assignment to individual fish. North American Journal of Fisheries Management, 25:1153-1160. [Was (is?) from http://www.tandfonline.com/doi/abs/10.1577/M04-130.1.] #' diff --git a/R/alkPlot.R b/R/alkPlot.R index 7141f299..af1ca08d 100644 --- a/R/alkPlot.R +++ b/R/alkPlot.R @@ -36,7 +36,7 @@ #' #' @seealso See \code{\link{alkIndivAge}} for using an age-length key to assign ages to individual fish. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @keywords plot #' diff --git a/R/alkSummaries.R b/R/alkSummaries.R index 6084eb74..e462df3c 100644 --- a/R/alkSummaries.R +++ b/R/alkSummaries.R @@ -27,7 +27,7 @@ #' #' @seealso See \code{\link{alkIndivAge}} and related functions for a completely different methodology. See \code{\link[fishmethods]{alkprop}} from \pkg{fishmethods} for the exact same methodology but with a different format for the inputs. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Lai, H.-L. 1987. Optimum allocation for estimating age composition using age-length key. Fishery Bulletin, 85:179-185. #' @@ -127,7 +127,7 @@ iALKAgeProp <- function(p_jgi,l_i,n_i,N) { #' #' @seealso See \code{\link{alkIndivAge}} and related functions for a completely different methodology. See \code{\link{alkAgeDist}} for a related method of determining the proportion of fish at each age. See the \pkg{ALKr} package. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Bettoli, P. W. and Miranda, L. E. 2001. A cautionary note about estimating mean length at age with subsampled data. North American Journal of Fisheries Management, 21:425-428. #' diff --git a/R/capHistConvert.R b/R/capHistConvert.R index bdc8841c..419eb3d1 100644 --- a/R/capHistConvert.R +++ b/R/capHistConvert.R @@ -96,7 +96,7 @@ #' #' @seealso See \code{\link{capHistSum}} to summarize \dQuote{individual} capture histories into a format usable in \code{\link{mrClosed}} and \code{\link{mrOpen}}. Also see \pkg{Rcapture}, \code{RMark}, or \pkg{marked} packages for handling more complex analyses. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @keywords manip #' diff --git a/R/capHistSum.R b/R/capHistSum.R index d0b56968..4862defa 100644 --- a/R/capHistSum.R +++ b/R/capHistSum.R @@ -41,7 +41,7 @@ #' #' @seealso See \code{\link[Rcapture]{descriptive}} in \pkg{Rcapture} for \code{m.array} and some of the same values in \code{sum}. See \code{\link{capHistConvert}} for a descriptions of capture history data file formats and how to convert between them. See \code{\link{mrClosed}} and \code{\link{mrOpen}} for how to estimate abundance from the summarized capture history information. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Baillargeon, S. and Rivest, L.-P. (2007). Rcapture: Loglinear models for capture-recapture in R. Journal of Statistical Software, 19(5):1-31. #' diff --git a/R/catchCurve.R b/R/catchCurve.R index f16a1690..3ed27ef4 100644 --- a/R/catchCurve.R +++ b/R/catchCurve.R @@ -46,7 +46,7 @@ #' #' @seealso See \code{\link[fishmethods]{agesurv}} in \pkg{fishmethods} for similar functionality. See \code{\link{chapmanRobson}} and \code{\link[fishmethods]{agesurvcl}} in \pkg{fishmethods} for alternative methods to estimate mortality rates. See \code{\link{metaM}} for empirical methods to estimate natural mortality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Maceina, M.J., and P.W. Bettoli. 1998. Variation in Largemouth Bass recruitment in four mainstream impoundments on the Tennessee River. North American Journal of Fisheries Management 18:998-1003. #' diff --git a/R/chapmanRobson.R b/R/chapmanRobson.R index 20cdf75d..c5b52b5e 100644 --- a/R/chapmanRobson.R +++ b/R/chapmanRobson.R @@ -46,7 +46,7 @@ #' #' @seealso See \code{\link[fishmethods]{agesurv}} in \pkg{fishmethods} for similar functionality. See \code{\link{catchCurve}} and \code{\link[fishmethods]{agesurvcl}} in \pkg{fishmethods} for alternative methods. See \code{\link{metaM}} for empirical methods to estimate natural mortality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Chapman, D.G. and D.S. Robson. 1960. The analysis of a catch curve. Biometrics. 16:354-368. #' diff --git a/R/depletion.R b/R/depletion.R index 2af06534..67c83c8f 100644 --- a/R/depletion.R +++ b/R/depletion.R @@ -54,7 +54,7 @@ #' #' @seealso See \code{\link{removal}} for related functionality and \code{\link[fishmethods]{deplet}} in \pkg{fishmethods} for similar functionality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Ricker, W.E. 1975. Computation and interpretation of biological statistics of fish populations. Technical Report Bulletin 191, Bulletin of the Fisheries Research Board of Canada. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/1485.pdf.] #' diff --git a/R/growthModels.R b/R/growthModels.R index 16886f6b..278c3985 100644 --- a/R/growthModels.R +++ b/R/growthModels.R @@ -50,7 +50,7 @@ #' #' @seealso See \code{\link{Schnute}} for an implementation of the Schnute (1981) model. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Campana, S.E. and C.M. Jones. 1992. Analysis of otolith microstructure data. Pages 73-100 In D.K. Stevenson and S.E. Campana, editors. Otolith microstructure examination and analysis. Canadian Special Publication of Fisheries and Aquatic Sciences 117. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/141734.pdf.] #' diff --git a/R/hist.formula.R b/R/hist.formula.R index ff771301..8fca533c 100644 --- a/R/hist.formula.R +++ b/R/hist.formula.R @@ -41,7 +41,7 @@ #' #' @section IFAR Chapter: 3-Plotting Fundamentals. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @seealso See base \code{\link[graphics]{hist}} for related functionality and \code{\link[plotrix]{multhist}} in \pkg{plotrix} for similar functionality. #' diff --git a/R/lencat.R b/R/lencat.R index 690fea0d..f11dfb87 100644 --- a/R/lencat.R +++ b/R/lencat.R @@ -30,7 +30,7 @@ #' #' @section IFAR Chapter: 2-Data Manipulation. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @keywords manip #' diff --git a/R/lwCompPreds.R b/R/lwCompPreds.R index ae9f8992..c0302657 100644 --- a/R/lwCompPreds.R +++ b/R/lwCompPreds.R @@ -28,7 +28,7 @@ #' #' @section IFAR Chapter: 7-Weight-Length. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @keywords manip #' diff --git a/R/metaM.R b/R/metaM.R index 3bb440cd..ebf6e657 100644 --- a/R/metaM.R +++ b/R/metaM.R @@ -61,7 +61,7 @@ #' #' @seealso See \code{\link[fishmethods]{M.empirical}} in \pkg{fishmethods} for similar functionality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Alverson, D.L. and M.J. Carney. 1975. A graphic review of the growth and decay of population cohorts. Journal du Conseil International pour l'Exploration de la Mer. 36:133-143. #' diff --git a/R/mrClosed.R b/R/mrClosed.R index f2f380e1..ebaa39d3 100644 --- a/R/mrClosed.R +++ b/R/mrClosed.R @@ -94,7 +94,7 @@ #' #' @seealso See \code{\link{capHistSum}} for generating input data from capture histories. See \code{\link{poiCI}}, \code{\link{binCI}}, and \code{\link{hyperCI}} for specifics on functions used in confidence interval construction. See \code{\link{mrOpen}} for handling mark-recapture data in an open population. See \code{\link[FSAdata]{SunfishIN}} in \pkg{FSAdata} for an example to test matching of results with Ricker (1975)' See \code{\link[fishmethods]{mrN.single}} and \code{\link[fishmethods]{schnabel}} in \pkg{fishmethods} for similar functionality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Krebs, C.J. 1989. Ecological Methodology. Addison-Welsey Educational Publishing. #' diff --git a/R/mrOpen.R b/R/mrOpen.R index b6e929c9..41636ff5 100644 --- a/R/mrOpen.R +++ b/R/mrOpen.R @@ -49,7 +49,7 @@ #' #' @seealso \code{\link{capHistSum}}, \code{\link{mrClosed}} #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Jolly, G.M. 1965. Explicit estimates from capture-recapture data with both death and immigration -- stochastic model. Biometrika, 52:225-247. #' diff --git a/R/nlsTracePlot.R b/R/nlsTracePlot.R index 87560440..ea652af5 100644 --- a/R/nlsTracePlot.R +++ b/R/nlsTracePlot.R @@ -77,12 +77,24 @@ nlsTracePlot <- function(object,fun,from=NULL,to=NULL,n=199, if (n<2) STOP("'n' must be greater than 2.") ## Determine if need to capture trace (if object is object from nls()) if (inherits(object,"nls")) { - object <- utils::capture.output( try(tmp <- stats::update(object,.~.,trace=TRUE),silent=TRUE) ) + object <- utils::capture.output( try(tmp <- stats::update(object,.~., + trace=TRUE), + silent=TRUE) ) } ## parse trace into a data.frame - trcDF <- unlist(strsplit(unlist(strsplit(object,":"))," ")) - trcDF <- as.numeric(trcDF[trcDF!=""]) - trcDF <- matrix(trcDF,nrow=length(object),byrow=TRUE) + ## The output of nls() when trace=TRUE changed with R version 4.1 ... thus + ## we need to handle pre-4.1 different from 4.1+ + newTraceVersion <- getRversion() >= "4.1" + if (newTraceVersion) { + trcDF <- sub(".*par = ","",object) + trcDF <- substring(trcDF,2,nchar(trcDF)-1) + trcDF <- unlist(strsplit(trcDF," ")) + } else { + trcDF <- sub(".*: ","",object) + trcDF <- unlist(strsplit(trcDF," ")) + trcDF <- trcDF[trcDF!=""] + } + trcDF <- matrix(as.numeric(trcDF),nrow=length(object),byrow=TRUE) ## plot each iteration onto existing plot if (add) { ## process legend @@ -94,7 +106,7 @@ nlsTracePlot <- function(object,fun,from=NULL,to=NULL,n=199, if (is.null(to)) to <- graphics::par("usr")[2L] xs <- seq(from,to,length.out=n) for (i in 1:niter) { - ys <- do.call(fun,list(xs,trcDF[i,-1])) + ys <- do.call(fun,list(xs,trcDF[i,])) graphics::lines(xs,ys,lwd=lwd,col=clrs[i]) } ## add legend if asked for diff --git a/R/psdAdd.R b/R/psdAdd.R index ffc073bd..8ac8c534 100644 --- a/R/psdAdd.R +++ b/R/psdAdd.R @@ -26,7 +26,7 @@ #' #' @seealso \code{\link{psdVal}}, \code{\link{psdCalc}}, \code{\link{psdPlot}}, \code{\link{PSDlit}}, and \code{\link{wrAdd}} for related functions. See \code{\link{mapvalues}} for help in changing species names to match those in \code{\link{PSDlit}}. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Guy, C.S., R.M. Neumann, and D.W. Willis. 2006. New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS). Fisheries 31:86-87. [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.] #' diff --git a/R/psdCI.R b/R/psdCI.R index 94752ed7..7699c1ea 100644 --- a/R/psdCI.R +++ b/R/psdCI.R @@ -27,7 +27,7 @@ #' #' @seealso See \code{\link{psdVal}}, \code{\link{psdPlot}}, \code{\link{psdAdd}}, \code{\link{PSDlit}}, \code{\link{tictactoe}}, \code{\link{lencat}}, and \code{\link{rcumsum}} for related functionality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Brenden, T.O., T. Wagner, and B.R. Murphy. 2008. Novel tools for analyzing proportional size distribution index data. North American Journal of Fisheries Management 28:1233-1242. [Was (is?) from http://qfc.fw.msu.edu/Publications/Publication\%20List/2008/Novel\%20Tools\%20for\%20Analyzing\%20Proportional\%20Size\%20Distribution_Brenden.pdf.] #' @@ -148,7 +148,7 @@ iPSDCImultinom <- function(indvec,ptbl,n,conf.level) { ") <20, CI coverage may be lower than ", 100*conf.level,"%.") ## create covariance matrix ... from hints at - ## http://stackoverflow.com/questions/19960605/r-multinomial-distribution-variance + ## https://stackoverflow.com/questions/19960605/r-multinomial-distribution-variance/ cov <- -outer(ptbl,ptbl) diag(cov) <- ptbl*(1-ptbl) ## get psd val asked for (drop gets rid of matrix result) diff --git a/R/psdCalc.R b/R/psdCalc.R index c54424dc..c5661ee6 100644 --- a/R/psdCalc.R +++ b/R/psdCalc.R @@ -30,7 +30,7 @@ #' #' @seealso See \code{\link{psdVal}}, \code{\link{psdPlot}}, \code{\link{psdAdd}}, \code{\link{PSDlit}}, \code{\link{tictactoe}}, \code{\link{lencat}}, and \code{\link{rcumsum}} for related functionality. #' -#' @references Ogle, D.H2016\href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}Chapman & Hall/CRC, Boca Raton, FL. #' #' Guy, C.S., R.M. Neumann, and D.W. Willis2006New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS)Fisheries 31:86-87 [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.] #' diff --git a/R/psdPlot.R b/R/psdPlot.R index ad8b521e..c1d47920 100644 --- a/R/psdPlot.R +++ b/R/psdPlot.R @@ -37,7 +37,7 @@ #' #' @seealso See \code{\link{psdVal}}, \code{\link{psdCalc}}, \code{\link{psdAdd}}, \code{\link{PSDlit}}, \code{\link{lencat}}, \code{\link{tictactoe}}, \code{\link{lencat}}, and \code{\link{rcumsum}} for related functionality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Guy, C.S., R.M. Neumann, and D.W. Willis. 2006. New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS). Fisheries 31:86-87. [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.] #' diff --git a/R/psdVal.R b/R/psdVal.R index c618eacd..21a89b65 100644 --- a/R/psdVal.R +++ b/R/psdVal.R @@ -22,7 +22,7 @@ #' #' @seealso See \code{\link{psdCalc}}, \code{\link{psdPlot}}, \code{\link{psdAdd}}, \code{\link{PSDlit}}, \code{\link{tictactoe}}, \code{\link{lencat}}, and \code{\link{rcumsum}} for related functionality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Guy, C.S., R.M. Neumann, and D.W. Willis. 2006. New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS). Fisheries 31:86-87. [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.] #' diff --git a/R/removal.R b/R/removal.R index f2058b53..4e668e88 100644 --- a/R/removal.R +++ b/R/removal.R @@ -72,7 +72,7 @@ #' #' @seealso See \code{\link{depletion}} for related functionality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Carle, F.L. and M.R. Strub. 1978. A new method for estimating population size from removal data. Biometrics, 34:621-630. #' diff --git a/R/srStarts.R b/R/srStarts.R index d992ff5a..ef5bca99 100644 --- a/R/srStarts.R +++ b/R/srStarts.R @@ -34,7 +34,7 @@ #' #' @seealso See \code{\link{srFunShow}} and \code{\link{srFuns}} for related functionality. See \code{\link{nlsTracePlot}} for help troubleshooting nonlinear models that don't converge. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Beverton, R.J.H. and S.J. Holt. 1957. On the dynamics of exploited fish populations, Fisheries Investigations (Series 2), volume 19. United Kingdom Ministry of Agriculture and Fisheries, 533 pp. #' diff --git a/R/stockRecruitment.R b/R/stockRecruitment.R index a75708ed..00a442a3 100644 --- a/R/stockRecruitment.R +++ b/R/stockRecruitment.R @@ -21,7 +21,7 @@ #' #' @seealso See \code{\link{srStarts}} for related functionality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' Beverton, R.J.H. and S.J. Holt. 1957. On the dynamics of exploited fish populations, Fisheries Investigations (Series 2), volume 19. United Kingdom Ministry of Agriculture and Fisheries, 533 pp. #' diff --git a/R/tictactoe.R b/R/tictactoe.R index 7abfc2c8..f2dbbe9d 100644 --- a/R/tictactoe.R +++ b/R/tictactoe.R @@ -22,7 +22,7 @@ #' #' @seealso See \code{\link{psdVal}} and \code{\link{psdCalc}} for related functionality. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @keywords hplot #' diff --git a/R/vbStarts.R b/R/vbStarts.R index 4e54977b..8cf5ee75 100644 --- a/R/vbStarts.R +++ b/R/vbStarts.R @@ -43,7 +43,7 @@ #' #' @seealso See \code{\link{growthFunShow}} to display the equations for the parameterizations used in \pkg{FSA} and \code{\link{vbFuns}} for functions that represent the von Bertalanffy parameterizations. See \code{\link{nlsTracePlot}} for help troubleshooting nonlinear models that don't converge. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' See references in \code{\link{vbFuns}}. #' diff --git a/R/wrAdd.R b/R/wrAdd.R index f1a5f331..ca84b887 100644 --- a/R/wrAdd.R +++ b/R/wrAdd.R @@ -19,7 +19,7 @@ #' #' @seealso See \code{\link{wsVal}}, \code{\link{WSlit}}, and \code{\link{psdAdd}} for related functionality. See \code{\link{mapvalues}} for help in changing species names to match those in \code{\link{WSlit}}. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @keywords manip #' diff --git a/R/wsVal.R b/R/wsVal.R index c2e9553d..96c72c7c 100644 --- a/R/wsVal.R +++ b/R/wsVal.R @@ -25,7 +25,7 @@ #' #' @section IFAR Chapter: 8-Condition. #' -#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +#' @references Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. #' #' @keywords manip #' diff --git a/README.md b/README.md index ca187b9b..a224008f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ## FSA (Fisheries Stock Assessment) -The **FSA** package provides R functions to conduct typical introductory fisheries analyses. Example analyses that use **FSA** can be found in the [Introductory Fisheries Analyses with R book](http://derekogle.com/IFAR/) and on [the *Examples* page](http://derekogle.com/fishR/examples/) of the [fishR website](http://derekogle.com/fishR). You can browse documentation for functions in **FSA** under the *References* tab and recent changes under the *News* tab at the top of this page. Please [cite **FSA**](http://derekogle.com/FSA/authors.html) if you use it in a publication (and [send me a note](mailto:derek@derekogle.com)). +The **FSA** package provides R functions to conduct typical introductory fisheries analyses. Example analyses that use **FSA** can be found in the [Introductory Fisheries Analyses with R book](http://derekogle.com/IFAR/) and on [the *Examples* page](http://derekogle.com/fishR/examples/) of the [fishR website](http://derekogle.com/fishR/). You can browse documentation for functions in **FSA** under the *References* tab and recent changes under the *News* tab at the top of this page. Please [cite **FSA**](http://derekogle.com/FSA/authors.html) if you use it in a publication (and [send me a note](mailto:derek@derekogle.com)). ### Installation The [most recent stable version (on CRAN)](https://cloud.r-project.org/package=FSA) of **FSA** may be installed with diff --git a/cran-comments/cran-comments-v0_8_31.md b/cran-comments/cran-comments-v0_8_31.md new file mode 100644 index 00000000..a3e60794 --- /dev/null +++ b/cran-comments/cran-comments-v0_8_31.md @@ -0,0 +1,10 @@ +* This updates the existing FSA package on CRAN by fixing an issue related to upcoming changes to nls (per e-mail from Martin Maechler on 2-Nov-2020). + +## Notes +* There may be a note about "fishR" being misspelled in the description. This is not a misspelling. +* On [CRAN](https://cran.r-project.org/web/checks/check_results_FSA.html), there is a note in the previous version about a missing `RMark` package for the "r-patched-solaris-x86" flavor. Again (as with previous versions), I am not sure what to do about this note. + +## Testing Environments +* My Windows machine. +* Win Builder -- old-release, release, and development. +# R-hub using check_for_cran(). \ No newline at end of file diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 83b6c527..68d001b8 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -79,7 +79,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -480,7 +480,7 @@

Contents

-

Site built with pkgdown 1.5.1.

+

Site built with pkgdown 1.6.1.

diff --git a/docs/authors.html b/docs/authors.html index 88cd7cbc..7bc19f59 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -79,7 +79,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -122,12 +122,12 @@

Citation

Source: inst/CITATION -

Ogle, D.H., P. Wheeler, and A. Dinno. 2020. FSA: Fisheries Stock Analysis. R package version 0.8.30.9000, https://github.com/droglenc/FSA.

+

Ogle, D.H., P. Wheeler, and A. Dinno. 2020. FSA: Fisheries Stock Analysis. R package version 0.8.31, https://github.com/droglenc/FSA.

@Manual{,
   title = {FSA: Fisheries Stock Analysis},
   author = {Derek H. Ogle and Powell Wheeler and Alexis Dinno},
   year = {2020},
-  note = {R package version 0.8.30.9000},
+  note = {R package version 0.8.31},
   url = {https://github.com/droglenc/FSA},
 }
@@ -162,7 +162,7 @@

Authors

-

Site built with pkgdown 1.5.1.

+

Site built with pkgdown 1.6.1.

diff --git a/docs/index.html b/docs/index.html index 20b95c67..78df80d8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -39,7 +39,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -83,15 +83,17 @@

FSA (Fisheries Stock Assessment)

-

The FSA package provides R functions to conduct typical introductory fisheries analyses. Example analyses that use FSA can be found in the Introductory Fisheries Analyses with R book and on the Examples page of the fishR website. You can browse documentation for functions in FSA under the References tab and recent changes under the News tab at the top of this page. Please cite FSA if you use it in a publication (and send me a note).

+

The FSA package provides R functions to conduct typical introductory fisheries analyses. Example analyses that use FSA can be found in the Introductory Fisheries Analyses with R book and on the Examples page of the fishR website. You can browse documentation for functions in FSA under the References tab and recent changes under the News tab at the top of this page. Please cite FSA if you use it in a publication (and send me a note).

Installation

The most recent stable version (on CRAN) of FSA may be installed with

- +

The most recent development version (on GitHub) may be installed with

-
if (!require('remotes')) install.packages('remotes'); require('remotes')
-remotes::install_github('droglenc/FSA')
+
+if (!require('remotes')) install.packages('remotes'); require('remotes')
+remotes::install_github('droglenc/FSA')

You may need to have R Tools installed on your system to install the development version from GitHub. See the instructions for (R Tools for Windows or R Tools for Mac OS X).

@@ -166,7 +168,7 @@

Dev status

-

Site built with pkgdown 1.5.1.

+

Site built with pkgdown 1.6.1.

diff --git a/docs/news/index.html b/docs/news/index.html index 3c66f1d9..95c08918 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -79,7 +79,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -122,13 +122,17 @@

Changelog

Source: NEWS.md -
+

-FSA 0.8.31 ongoing Unreleased +FSA 0.8.31 7-Nov20 Unreleased

  • Now using roxygen v7.1.1.
  • +
  • Added tibble to suggests (see comment about headtail() below).
  • Cleaned up the documentation of parameters for RichardsFuns() (documentation did not change when parameter letters were changed for the Age and Growth book).
  • +
  • Changed example in headtail() to use as_tibble() from tibble package rather than tbl_df() from dplyr package. Required adding tibble to suggests.
  • +
  • +nlsTracePlot(): Modified. Created a conditional catch depending on the version of R as the results of nls(*,trace=TRUE) are changing in v4.1.0 (per e-mail from Martin Maechler on 2-Nov-20).
@@ -175,7 +179,7 @@

  • Now using ROxygen2 7.0.2.
  • -
  • Removed dependency on gplots package as it is now orphaned. Required adding iRichColors() internal function.
  • +
  • Removed dependency on gplots package as it is now orphaned. Required adding iRichColors() internal function.
  • lwCompPreds(): Removed \dots from arguments as it was not in usage (per request from CRAN on 3-Feb-20).
  • @@ -234,7 +238,7 @@

  • hist.formula(): Modified. Fixed bug related to subsequent calls after a call that used iaxs=FALSE. This addresses #46.
  • -iLegendHelp(): Modified. Added a catch if a proper keyword is not supplied.
  • +iLegendHelp(): Modified. Added a catch if a proper keyword is not supplied.

  • nlsTracePlot(): Modified. Moved error catching for improper keyword for legend placement forward.
  • @@ -271,23 +275,23 @@

  • alkIndivAge(): Modified. Replaced an options(warn=-1) with suppressWarnings().
  • -alkPlot(): Modified. Changed to using withr::local_par() (partially addresses #38). Replaced an options(warn=-1) with suppressWarnings().
  • +alkPlot(): Modified. Changed to using withr::local_par() (partially addresses #38). Replaced an options(warn=-1) with suppressWarnings().

  • alkSummaries(): Modified. Replaced an options(warn=-1) with suppressWarnings().
  • -
  • Bootstrapping functions: Modified. Changed to using withr::local_par() (partially addresses #38).
  • +
  • Bootstrapping functions: Modified. Changed to using withr::local_par() (partially addresses #38).
  • -capHistSum(): Modified. Changed to using withr::local_par() (partially addresses #38).
  • +capHistSum(): Modified. Changed to using withr::local_par() (partially addresses #38).
  • -chapmanRobson(): Modified. Changed to using withr::local_par() (partially addresses #38).
  • +chapmanRobson(): Modified. Changed to using withr::local_par() (partially addresses #38).
  • fishR(): Modified. Changed examples in documentation to not be run (so as not to open an external webpage).
  • FSAnews(): Modified. Changed examples in documentation to not be run (so as not to open an external webpage).
  • -
  • Growth models: Modified. Changed to using withr::local_par() (partially addresses #38).
  • +
  • Growth models: Modified. Changed to using withr::local_par() (partially addresses #38).
  • -hist.formula(): Modified. Changed to using withr::local_par() (partially addresses #38).
  • +hist.formula(): Modified. Changed to using withr::local_par() (partially addresses #38).
  • -lwCompPreds(): Modified. Changed to using withr::local_par() (partially addresses #38).
  • +lwCompPreds(): Modified. Changed to using withr::local_par() (partially addresses #38).
  • plotAB(): Modified. Now in its own documentation file (rather than with ageBias()).
  • @@ -295,7 +299,7 @@

  • removal(): Modified. Added method="Burhnam" via the #51 from Powell Wheeler.
  • -residPlot(): Modified. Changed to using withr::local_par() (partially addresses #38).
  • +residPlot(): Modified. Changed to using withr::local_par() (partially addresses #38).

  • SMBassWB: Modified. Fixed minor data entry error in row 383.
  • @@ -336,7 +340,7 @@

  • bcFuns(): Modified. Changed three 1:length() structures to seq_along() (partially addressing #36).
  • -bootCase() methods: Modified. Changed all 1: structures to seq_len() (partially addressing #36).
  • +bootCase() methods: Modified. Changed all 1: structures to seq_len() (partially addressing #36).

  • capHistConvert(): Modified. Changed all 1: structures to seq_len() or seq_along() (partially addressing #36).
  • @@ -356,7 +360,7 @@

  • htest.boot(): Removed (added last version) until I can test more.
  • -iHndlFormula(): Modified. Now categorizes a character variable as a factor variable. This addresses #35) for hist.formula() and Summarize().
  • +iHndlFormula(): Modified. Now categorizes a character variable as a factor variable. This addresses #35) for hist.formula() and Summarize().

  • lrt(): Modified. Changed all 1: structures to seq_len() or seq_along() (partially addressing #36).
  • @@ -364,7 +368,7 @@

  • mrClosed(): Modified. Changed two 1:length() structures to seq_along() (partially addressing #36).
  • -nlsBoot() methods: Modified. Changed all 1: structures to seq_len() (partially addressing #36).
  • +nlsBoot() methods: Modified. Changed all 1: structures to seq_len() (partially addressing #36).

  • plot.boot(): Removed (added last version) until I can test more.
  • @@ -387,7 +391,7 @@

  • Changed to depending on R >=3.2.0, because that is the latest version required by a package (i.e., car) that FSA imports or suggests. Used the “check_r_versions_of_package_dependencies” shiny app by “ateucher” (on Github) to help determine this.
  • Using latest testthat package.
  • -bootCase(): Added. This was added because bootCase() will soon be removed from the car package. It was added so that the code in the Introductory Fisheries Analyses with R book will still work. It is largely a wrapper to Boot() in car with method="case". The documentation was updated somewhat.
  • +bootCase(): Added. This was added because bootCase() will soon be removed from the car package. It was added so that the code in the Introductory Fisheries Analyses with R book will still work. It is largely a wrapper to Boot() in car with method="case". The documentation was updated somewhat.

  • catchCurve(): Modified. Changed the weighted regression method so that negative weights are set to zero rather than the minimum of the positive values (brought to my attention by Vaskar Nepal KC). Also added an rSquared() method (per request by Vaskar Nepal KC).
  • @@ -454,7 +458,7 @@

    • Moved dunn.test and lmtest to imports to help with portability for workshops.
    • -ageBias(): Modified. Fixed bug in plot() so that the tick marks on the marginal histograms match the tick marks on the main plot. Changed the default hist.panel.size= in plot() so that it more reliably prints the values on the axes of the marginal histograms.
    • +ageBias(): Modified. Fixed bug in plot() so that the tick marks on the marginal histograms match the tick marks on the main plot. Changed the default hist.panel.size= in plot() so that it more reliably prints the values on the axes of the marginal histograms.
    • removal(): Modified. Added “warnings” for when all catches are zeroes (an object is still returned with all NAs). Thanks to Daniel Hanks for pointing out this issue.
    • @@ -477,19 +481,19 @@

    • lagratio(): Modified. Changed some if()s with class()es to inherits().
    • -iHndlCols2UseIgnore(): Modified. Changed some if()s with class()es to inherits().
    • +iHndlCols2UseIgnore(): Modified. Changed some if()s with class()es to inherits().

    • -iLegendHelp(): Modified. Changed some if()s with class()es to inherits().
    • +iLegendHelp(): Modified. Changed some if()s with class()es to inherits().
    • iPredictBoot(): Modified. Changed some if()s with class()es to inherits().
    • is.CapHist(): Added.
    • -iTypeoflm(): Modified. Added a catch for a linear model that has a character variable (now alerts the user with a warning).
    • +iTypeoflm(): Modified. Added a catch for a linear model that has a character variable (now alerts the user with a warning).
    • mrClosed(): Modified. Changed some if()s with class()es to is.CapHist().
    • -mrOpen(): Modified. Changed some if()s with class()es to is.CapHist().
    • +mrOpen(): Modified. Changed some if()s with class()es to is.CapHist().
    • nlsTracePlot(): Modified. Changed some if()s with class()es to inherits().
    • @@ -514,9 +518,9 @@

    • Lots of spelling corrections after running devtools::spell_check().
    • Cleaned up some issues in the testing files that were caused by a new version of fishmethods and changes to R v3.4.0.
    • -metaM(): Modified. Changed T= to Temp= to reduce potential for conflicts with TRUE abbreviation.
    • +metaM(): Modified. Changed T= to Temp= to reduce potential for conflicts with TRUE abbreviation.

    • -reproInfo(): Modified. Added ind= to select a CRAN mirror to help with a common problem I have when knitting.
    • +reproInfo(): Modified. Added ind= to select a CRAN mirror to help with a common problem I have when knitting.
    • srStarts(): Modified. Corrected mis-spelling in directive to FSAsim package.
    • @@ -528,13 +532,13 @@

      FSA 0.8.11 13-Dec-16 2016-12-13

        -
      • Changed all stop()s to STOP()s and all warning()s to WARN(). This modified nearly all functions.
      • +
      • Changed all stop()s to STOP()s and all warning()s to WARN(). This modified nearly all functions.
      • Changed all paste()s that used sep="" to paste0()s.
      • Removed several sep=""s from message()s.
      • Removed Hmisc from, but added epitools to, imports. Removed all links to Hmisc to remove CRAN check warnings.
      • Reorganized testing files. Added many tests.
      • -.onAttach(): Modified. Streamlined package startup message.
      • +.onAttach(): Modified. Streamlined package startup message.
      • addZeroCatch(): Modified. Added more “catches” for bad data types or arguments.
      • @@ -556,43 +560,43 @@

      • fitPlot(): Modified. Added cex.leg= and box.lty.leg= to IVR plots.
      • -hist.formula(): Modified. Fixed a bug with adding the horizontal line at 0 when the user uses plot=FALSE, which occurs with hist.bootCase().
      • +hist.formula(): Modified. Fixed a bug with adding the horizontal line at 0 when the user uses plot=FALSE, which occurs with hist.bootCase().

      • hyperCI(): Modified. Now only accepts whole numbers for M, n, or m. Added catch for bad conf.levels and multiple values of M, n, or m.
      • -iAddLoessLine(): Modified. Changed used of iMakeColor() to col2rgbt().
      • +iAddLoessLine(): Modified. Changed used of iMakeColor() to col2rgbt().
      • -iGetDecimals(): Modified. Added warning for situations where x will be presented in exponential notation. Also returned a decimal of zero in this situation. Helps with a bug in hist.formula().
      • +iGetDecimals(): Modified. Added warning for situations where x will be presented in exponential notation. Also returned a decimal of zero in this situation. Helps with a bug in hist.formula().
      • -iHndlCols2use(): Deleted. Changed to iHndlCols2UseIgnore().
      • +iHndlCols2use(): Deleted. Changed to iHndlCols2UseIgnore().
      • -iHndlCols2UseIgnore(): Added. Previously was iHndlCols2use(). Completely reworked to catch more problems including having both positive and negative indices (fixes #24) and choosing variable names that don’t exist (fixes #25).
      • +iHndlCols2UseIgnore(): Added. Previously was iHndlCols2use(). Completely reworked to catch more problems including having both positive and negative indices (fixes #24) and choosing variable names that don’t exist (fixes #25).
      • -iHndlFormula(): Modified. Added code to deal with a formula that is a single “variable” sent in an array. Addresses #21 for the simple situation of single “variable.”
      • +iHndlFormula(): Modified. Added code to deal with a formula that is a single “variable” sent in an array. Addresses #21 for the simple situation of single “variable.”
      • -iHndlMultWhat(): Modified. Added type= to allow use with message() or cat().
      • +iHndlMultWhat(): Modified. Added type= to allow use with message() or cat().
      • -iPlotExists(): Added. Helps with bug fix in hist.formula().
      • +iPlotExists(): Added. Helps with bug fix in hist.formula().
      • -is.wholenumber(): Added. Needed for changes to binCI(), hyperCI(), and poiCI().
      • +is.wholenumber(): Added. Needed for changes to binCI(), hyperCI(), and poiCI().
      • -kCounts(): Modified. Fixed bug with capitalize= and zero. Streamlined code. Added tests.
      • +kCounts(): Modified. Fixed bug with capitalize= and zero. Streamlined code. Added tests.
      • -metaM(): Modified. Fixed bug with the way messages were output when multiple methods were provided and justM=FALSE. Added more tests.
      • +metaM(): Modified. Fixed bug with the way messages were output when multiple methods were provided and justM=FALSE. Added more tests.
      • mrClosed(): Modified. Added poi.type= to handle new choices for Poisson confidence interals. Added some checks for non-vector uses of M= and R= (partially addresses #22). Fixed bug in how inputs for subgroups were output from summary() when verbose=TRUE.
      • -mrOpen(): Modified. Changed all message()s in summary() to cat()s. Fixed bug where returned value from summary() was not a data.frame if only one parameter was selected.
      • +mrOpen(): Modified. Changed all message()s in summary() to cat()s. Fixed bug where returned value from summary() was not a data.frame if only one parameter was selected.
      • nlsTracePlot(): Added.
      • -plotBinResp(): Modified. Changed used of iMakeColor() to col2rgbt().
      • +plotBinResp(): Modified. Changed used of iMakeColor() to col2rgbt().
      • poiCI(): Modified. Completely rebuilt to use the functions from epitools. Now only accepts whole numbers for x.
      • -predict.bootCase(): Modified. Modified so that situations where other than values of the dependent variable are in the dots argument (as would occur if making predictions for the Francis parameterization of the VBGF).
      • +predict.bootCase(): Modified. Modified so that situations where other than values of the dependent variable are in the dots argument (as would occur if making predictions for the Francis parameterization of the VBGF).
      • -predict.nlsBoot(): Modified. See note for predict.bootCase().
      • +predict.nlsBoot(): Modified. See note for predict.bootCase().
      • psdCalc(): Modified. Fixed bug in output if more than two additional lengths were supplied.
      • @@ -600,7 +604,7 @@

      • residPlot(): Modified. Added cex.leg= and box.lty.leg= to IVR plots. Removed extra spaces in main title if main="MODEL". Added some tests.
      • -tictactoe(): Modified. Changed used of iMakeColor() to col2rgbt().
      • +tictactoe(): Modified. Changed used of iMakeColor() to col2rgbt().

      • vbFuns(): Modified. Added Ogle to list of parameterizations. Changed order of L0 and K parameters in returned function when param="Original".
      • @@ -619,21 +623,21 @@

      • chapmanRobson(): Modified. Added axis.age= argument that allows the user to choose which type of x-axis is displayed (see examples; this addresses #20) Also modified code that adds the axes so that they should “look better” in more instances. Added na.rm=TRUE to y-range calculation for the plot method. Added a coef() method. Added a parm= argument to the confint() and summary() methods. Added tests.
      • -confint.nlsBoot(),confint.bootCase(). Modified. Result is now a matrix even if only one parameter is chosen (previously it was an unnamed vector). The parm= now properly handles negative values. Streamlined plotting results. Added tests.
      • +confint.nlsBoot(),confint.bootCase(). Modified. Result is now a matrix even if only one parameter is chosen (previously it was an unnamed vector). The parm= now properly handles negative values. Streamlined plotting results. Added tests.

      • depletion(): Modified. Checked for bad conf.level= in confint() method.
      • GompertzFuns(): Modified. Fixed bug related to selecting QuinnDeriso3.
      • -htest.nlsBoot(),htest.bootCase(). Modified. The b0 now defaults to 0. Matrix of results now include the parameter as the rowname. Modified the internals of how the data are handled. Added tests.
      • +htest.nlsBoot(),htest.bootCase(). Modified. The b0 now defaults to 0. Matrix of results now include the parameter as the rowname. Modified the internals of how the data are handled. Added tests.
      • -iAddLoessLine(): Modified. Suppressed warnings related to the loess line predictions.
      • +iAddLoessLine(): Modified. Suppressed warnings related to the loess line predictions.
      • mrClosed(): Modified. Checked for bad conf.level= in confint() method.
      • -mrOpen(): Modified. Checked for bad conf.level= in confint() method.
      • +mrOpen(): Modified. Checked for bad conf.level= in confint() method.
      • -predict.nlsBoot(), predict.bootCase(). Modified. The ... argument can now contain a vector of values such that predictions can be made for multiple values of the independent variable. Modified the output matrix to handle this modification. Removed MARGIN as it will always be 1 for nlsBoot and bootCase objects. Added checks for FUN=, conf.level=, and digits=. Added tests.
      • +predict.nlsBoot(), predict.bootCase(). Modified. The ... argument can now contain a vector of values such that predictions can be made for multiple values of the independent variable. Modified the output matrix to handle this modification. Removed MARGIN as it will always be 1 for nlsBoot and bootCase objects. Added checks for FUN=, conf.level=, and digits=. Added tests.
      • removal(): Modified. Checked for bad conf.level= in confint() method. Changed internal functions from using a loop to using apply(). Changed internal functions from using log() and choose() to using lchoose().
      • @@ -680,7 +684,7 @@

      • Compiled under R v3.3.0.
      • Removed relax from Suggests. See srStarts() and vbStarts() notes below. This addresses #17.
      • Removed gdata from Imports. See filterD() and Subset() notes below. This addresses #5.
      • -
      • Added no coverage blocks to ageKeyPlot(), capHistSum(), hist.formula(), histFromSum(), lwCompPreds(), plot.agebias(), plot.CatchCurve(), plot.ChapmanRobson(), plot.Depletion(), plotBinResp(), print.compSlopes(), print.compIntercepts(), print.metaM(), psdPlot(),residPlot(), srModels(), srStarts(), and vbStarts().
      • +
      • Added no coverage blocks to ageKeyPlot(), capHistSum(), hist.formula(), histFromSum(), lwCompPreds(), plot.agebias(), plot.CatchCurve(), plot.ChapmanRobson(), plot.Depletion(), plotBinResp(), print.compSlopes(), print.compIntercepts(), print.metaM(), psdPlot(),residPlot(), srModels(), srStarts(), and vbStarts().
      • ageKey(): Removed. Deprecated since 0.4.24. Use alkIndivAge().
      • @@ -698,7 +702,7 @@

      • GompertzModels(): Removed. Replaced with growthFunShow().
      • -iGetDecimals(): Modified. Fixed a bug that occured when an integer was provided.
      • +iGetDecimals(): Modified. Fixed a bug that occured when an integer was provided.

      • lenFreqExpand(): Removed. Deprecated since 0.4.32. Use expandLenFreq().
      • @@ -741,13 +745,13 @@

      • hist.formula(): Modified. Added the breaks= argument (mostly a pass-through) and the w= argument that allows the user to just set the width of the bins without having to set each break value. This should complete #15.
      • -iCheckStartCatW(): Modified. Now use iGetDecimals() to extract the number of decimals in startcat and w.
      • +iCheckStartCatW(): Modified. Now use iGetDecimals() to extract the number of decimals in startcat and w.

      • iCheckStartcat(): Added.
      • iCheckW(): Added.
      • -iGetDecimals(): Added.
      • +iGetDecimals(): Added.

      • lencat(): Modified. Changed order of startcat= and breaks=. Slight modifications to documentation.
      • @@ -757,7 +761,7 @@

      • psdVal(): Modified. Minor changes to documentation.
      • -purl2(): Modified. Added delHeader= argument and functionality.
      • +purl2(): Modified. Added delHeader= argument and functionality.

@@ -770,9 +774,9 @@

  • ageBias(): Modified. Minor corrections to the documentation.

  • agePrecision(): Modified. Fixed bug related to computations of percent agreement when NA values were present. There was an inconsistency between when what="precision" and what="difference" was used in summary(). The bug fix now properly divides by the “valid sample size” for what="precision". This fixes #9 (Thanks to Joseph Feldhaus). Now returns validn. Modifications to the documentation.

  • histFromSum(): Added. Addresses #4.

  • -
  • metaM(): Modified. Changed order of methods in methods=. Minor corrections and additions to documentation.

  • +
  • metaM(): Modified. Changed order of methods in methods=. Minor corrections and additions to documentation.

  • mrClosed(): Modified. Now sends warning if an NA appears in the first position of m, the first position of M, or the last position of R and converts these to 0 so that the procedure can continue. Each of these positions is ignored in the calculations. This fixes #8 (Thanks to Joe Mrnak).

  • -
  • reproInfo(): Modified. Made changes to iGetAllDependencis() based on forthcoming changes to package.dependencies() (as notified by CRAN).

  • +
  • reproInfo(): Modified. Made changes to iGetAllDependencis() based on forthcoming changes to package.dependencies() (as notified by CRAN).

  • vbStarts(): Modified. Fixed bug when dynamicPlot=TRUE was used.

  • @@ -862,7 +866,7 @@

  • headtail(): Modified. Changed head() to utils::head() and tail() to utils::tail().
  • -hist.bootCase(): Modified. Changed hist() to hist.formula().
  • +hist.bootCase(): Modified. Changed hist() to hist.formula().
  • iAgeBiasPlot(): Modified. Changed grconvertY() to graphics::grconvertY().
  • @@ -880,13 +884,13 @@

  • iHistResids(): Modified. Removed graphics::hist() and changed to hist.formula().
  • -iHndlFormula(): Modified. Changed terms() to stats::terms().
  • +iHndlFormula(): Modified. Changed terms() to stats::terms().

  • iHndlResidType(): Modified. Changed rstandard() to stats::rstandard() and rstudent() to stats::rstudent().
  • iHtestBoot(): Modified. Removed graphics::hist() and changed to hist.formula().
  • -iMakeColor(): Modified. Changed rgb() to grdevices::rgb().
  • +iMakeColor(): Modified. Changed rgb() to grdevices::rgb().
  • iMakeModelHeading(): Modified. Changed formula() to stats::formula() (within an lapply()).
  • @@ -896,7 +900,7 @@

  • iSchnute(): Modified. Changed optimize() to grdevices::optimize().
  • -iTypeoflm(): Modified. Changed formula() to stats::formula().
  • +iTypeoflm(): Modified. Changed formula() to stats::formula().

  • plot.AgeBias(): Modified. Changed rgb() to grdevices::rgb().
  • @@ -908,7 +912,7 @@

  • psdVal(): Modified. Changed data() to utils::data().
  • -reproInfo(): Modified. Changed graphics.off() to grdevices::graphics.off().
  • +reproInfo(): Modified. Changed graphics.off() to grdevices::graphics.off().

  • removal(): Modified. Removed some of the examples from the help page to reduce the elapsed time for CRAN.
  • @@ -937,9 +941,9 @@

    • -purl2(): Added newname= to allow the output file to have a name other than the same as the intput file.
    • +purl2(): Added newname= to allow the output file to have a name other than the same as the intput file.
    • -reproInfo(): Added markdown to the out= types.
    • +reproInfo(): Added markdown to the out= types.
  • @@ -991,9 +995,9 @@

    @@ -1030,7 +1034,7 @@

    mapvalues(): Modified. Changed so that it is a direct importFrom and export without creating a help file in FSA.
  • -purl2(): Modified. Check forknitr with requireNamespaces() before processing body of function. This allowed moving knitr into Suggests declarations rather than Imports.
  • +purl2(): Modified. Check forknitr with requireNamespaces() before processing body of function. This allowed moving knitr into Suggests declarations rather than Imports.
  • residPlot(): Modified. Check forcar with requireNamespaces() before highlighting outliers on the plot. This allowed moving sciplot into Suggests declarations rather than Imports.
  • @@ -1046,7 +1050,7 @@

    FSA 0.7.3 Aug15 Unreleased

      -
    • Removed all importFrom() directives and went to hard-wiring to packages with ::. Added imports() directives for stats, graphics, tools, and grDevices. Removed imports() directive for multcomp().
    • +
    • Removed all importFrom() directives and went to hard-wiring to packages with ::. Added imports() directives for stats, graphics, tools, and grDevices. Removed imports() directive for multcomp().
    • vbStarts(): Modified. Changed default methos for methEV=. Changed order of starting values for type="Mooij" in order to match that from vbFuns(). This also fixed a bug when dynamicPlot=TRUE was used with type="Mooij". Added tests to determine if parameter order is the same between vbStarts() and vbFuns() for all parameterizations.
    @@ -1088,9 +1092,9 @@

  • alkPlot(): Cleaned-up help file and tests. No change in behavior.
  • -confint.bootCase(): Modified. Created a common internal function for use with confint.nlsBoot(). Added the ability to plot histograms with confidence intervals superimposed (similar to what was in confint.nlsBoot()).
  • +confint.bootCase(): Modified. Created a common internal function for use with confint.nlsBoot(). Added the ability to plot histograms with confidence intervals superimposed (similar to what was in confint.nlsBoot()).

  • -confint.nlsBoot(): Modified. Created a common internal function for use with confint.bootCase().
  • +confint.nlsBoot(): Modified. Created a common internal function for use with confint.bootCase().
  • GompertzFuns(): Moved into growthModels file. Did not change behavior.
  • @@ -1100,19 +1104,19 @@

  • hist.formula(): Modified. Fixed so that ymax= also sets the y-axis limit when only one histogram is made (it was previously ignored).
  • -htest.bootCase(): Modified. Created a common internal function for use with htest.nlsBoot().
  • +htest.bootCase(): Modified. Created a common internal function for use with htest.nlsBoot().

  • -htest.nlsBoot(): Modified. Created a common internal function for use with htest.bootCase().
  • +htest.nlsBoot(): Modified. Created a common internal function for use with htest.bootCase().
  • -iHndlFormula(): Modified. Added na.action=NULL to model.frame() so that NA values will not be omitted.
  • +iHndlFormula(): Modified. Added na.action=NULL to model.frame() so that NA values will not be omitted.
  • logisticFuns(): Moved into growthModels file. Did not change behavior.
  • logisticModels(): Modified. Changed type= to family= to avoid confusion in the help file with type= in logisticFuns(). Moved into growthModels file.
  • -predict.bootCase(): Modified. Created a common internal function for use with predict.nlsBoot().
  • +predict.bootCase(): Modified. Created a common internal function for use with predict.nlsBoot().
  • -predict.nlsBoot(): Modified. Created a common internal function for use with predict.bootCase().
  • +predict.nlsBoot(): Modified. Created a common internal function for use with predict.bootCase().
  • psdAdd(): Modified. Fixed bug that never tested if all lengths were NA. Required change to iHndlFormula.
  • @@ -1139,9 +1143,9 @@

  • Fixed several URL references, deleted others that have changed and are no longer available.
  • Updated CITATION file (to remove CRAN note).
  • -hist.formula(): Modified. Rebuilt to use iHndlFormula(). Modified how xlab= is used (result is the same). Added some tests.
  • +hist.formula(): Modified. Rebuilt to use iHndlFormula(). Modified how xlab= is used (result is the same). Added some tests.

  • -ksTest(): Modified. Rebuilt to use iHndlFormula(). Added some tests for messages and to make sure results matched ks.test().
  • +ksTest(): Modified. Rebuilt to use iHndlFormula(). Added some tests for messages and to make sure results matched ks.test().

    @@ -1187,7 +1191,7 @@

    @@ -1441,7 +1445,7 @@

  • logisticModels(): Added.
  • -reproInfo(): Modified. Added the out= argument to allow the output to be straight R or LaTeX. Removed the listFiles= argument. Changed the output to be more succinct. Streamlined the code.
  • +reproInfo(): Modified. Added the out= argument to allow the output to be straight R or LaTeX. Removed the listFiles= argument. Changed the output to be more succinct. Streamlined the code.
  • vbFuns(): Modified. Fixed a bug with the Laslett model.
  • @@ -1452,27 +1456,27 @@

    @@ -1678,7 +1682,7 @@

  • hist.formula(): Modified. Changed use of par() to eliminate modifications to the gridding of plots after the function is complete. Also removed the setting of mar= and mgp= in par().
  • -mrOpen(): Modified. Removed pretty printing for summary() and confint() methods. These got in the way of being able to cbind() the results together for a succinct display.
  • +mrOpen(): Modified. Removed pretty printing for summary() and confint() methods. These got in the way of being able to cbind() the results together for a succinct display.
  • residPlot(): Modified. Changed use of par() to eliminate modifications to the gridding of plots after the function is complete.
  • @@ -1689,15 +1693,15 @@

    @@ -1773,7 +1777,7 @@

  • alkPlot(): Modified. Changed behavior for adding a legend to alleviate a bug.
  • -metaM(): Added.
  • +metaM(): Added.

    @@ -1782,7 +1786,7 @@

    @@ -1986,7 +1990,7 @@

    tictactoe(): Modfied.
  • -tictactoeAdd(): Removed. Directed user to use plotCI() from plotrix instead.
  • +tictactoeAdd(): Removed. Directed user to use plotCI() from plotrix instead.

    @@ -2032,7 +2036,7 @@

  • iCheck ALK(): Added as an internal function (used to test the structure of the age-length keys in several other functions).
  • -summary.mrOpen(): Modified. Removed “Estimates” heading if verbose=FALSE.
  • +summary.mrOpen(): Modified. Removed “Estimates” heading if verbose=FALSE.
  • Summarize(): Modified. Moved all internal functions outside of Summarize() environment (and renamed them).
  • @@ -2082,7 +2086,7 @@

    @@ -2094,11 +2098,11 @@

  • capHistSum(): Modified. Changed column and row labels for $methodB.top and column labels for $methodB.bot. Added a m-array object for when more than two sampling events are present. Added calculations for the number of fish first seen on event i (ui), the number of fish last seen on event i (vi), and the number of fish seen i times (fi) to $sum.
  • -jolly(): Added. Same as mrOpen(), added only for convenience.
  • +jolly(): Added. Same as mrOpen(), added only for convenience.
  • mrClosed(): Modified. Fixed bugs around printing of CI type with Schnabel and the ignoring of conf.level= with Schnabel.
  • -mrOpen: Modified. Changed ci.type= to type= and phi.type= to phi.full=. Removed type= from summary() and added a verbose= which will print only the estimates if FALSE or both observables and estimates if TRUE. Added a verbose= to confint() to control whether the message about the type of confidence interval is printed or not. Moved all internal functions outside of mrOpen() environment and added other internal functions to isolate all intermediate calculations. Changes to row and column labels in capHistSum() resulted in changes to row lables for summary() and confint() results. Streamlined some clunky code. Added checks for misformed mb.top= and mb.bot=. Added tests and notes in the code as to sources for the fomulae.
  • +mrOpen: Modified. Changed ci.type= to type= and phi.type= to phi.full=. Removed type= from summary() and added a verbose= which will print only the estimates if FALSE or both observables and estimates if TRUE. Added a verbose= to confint() to control whether the message about the type of confidence interval is printed or not. Moved all internal functions outside of mrOpen() environment and added other internal functions to isolate all intermediate calculations. Changes to row and column labels in capHistSum() resulted in changes to row lables for summary() and confint() results. Streamlined some clunky code. Added checks for misformed mb.top= and mb.bot=. Added tests and notes in the code as to sources for the fomulae.
  • plot.CapHistSum(): Added.
  • @@ -2167,17 +2171,17 @@

  • residPlot(): Modified. Changed the loess-related methods to use loess(), to put an approximate confident band with the line, the line and band are “under” the points, the line is lighter. Put the horizontal reference line at zero under the points. Made loess=TRUE the default.
  • -iAddLoessLine(): Modified. See residPlot().
  • +iAddLoessLine(): Modified. See residPlot().

  • -iHndlFormula(): Modified. COrrected the positioning of the explanatory variables when the model has a response variable.
  • +iHndlFormula(): Modified. COrrected the positioning of the explanatory variables when the model has a response variable.
  • iMakeBaseResidPlot(): Added as an internal function to residPlot() to simplify some coding.
  • -iMakeColor(): Modified. More intelligently handles values that are greater than 1 (converts them to decimals by inverting.)
  • +iMakeColor(): Modified. More intelligently handles values that are greater than 1 (converts them to decimals by inverting.)
  • -lwPredsComp(): Modified. Changed mdl= to object=. Added use of internal iHndlFormula() and moved two internal functions outside the main function. Changed default for intervals from both to confidence and changed so that if only the confidence or prediction intervals are plotted they will be black with lwd= width (if both are plotted the CI is now black and the PI is now blue). Added a show.preds argument. Changed connect.means= to connect.preds=. Changed default lwd= value and how it is used for CIs, PIs, and the connection lines. Added col.connect= argument. Removed mar and mgp from par() call (left mfrow). Added more examples. Added tests for error messages.
  • +lwPredsComp(): Modified. Changed mdl= to object=. Added use of internal iHndlFormula() and moved two internal functions outside the main function. Changed default for intervals from both to confidence and changed so that if only the confidence or prediction intervals are plotted they will be black with lwd= width (if both are plotted the CI is now black and the PI is now blue). Added a show.preds argument. Changed connect.means= to connect.preds=. Changed default lwd= value and how it is used for CIs, PIs, and the connection lines. Added col.connect= argument. Removed mar and mgp from par() call (left mfrow). Added more examples. Added tests for error messages.
  • -residPlot(): Modified. Added inclHist= argument. Corrected a bug around the use of thigmophobe() in iAddOutlierTest(). Changed default for student= to FALSE. Modified and added more examples.
  • +residPlot(): Modified. Added inclHist= argument. Corrected a bug around the use of thigmophobe() in iAddOutlierTest(). Changed default for student= to FALSE. Modified and added more examples.
  • SMBassWB: Modified. Added a seealso.
  • @@ -2189,19 +2193,19 @@

    • lots of roxygen2 Rd cleaning.
    • -addLoessLine(): Deleted. Moved functionality to iAddLoessLine() and moved code to residPlot() file..
    • +addLoessLine(): Deleted. Moved functionality to iAddLoessLine() and moved code to residPlot() file..
    • addOutlierTestResults(): Deleted. Moved functionality to iAddOutlierTestResults() and moved code to residPlot() file.
    • capHistConvert(): Added an interactive() to the Rcapture example in the help file.
    • -checkStartcatW(): Deleted. Moved functionality to iCheckStartcatW().
    • +checkStartcatW(): Deleted. Moved functionality to iCheckStartcatW().
    • ci.fp(): Deleted. Moved functionality to iCIfp() and moved code to fitPlot() file.
    • ci.fp.1(): Deleted. Moved functionality to iCIfp1() and moved code to fitPlot() file.
    • -ciLabel(): Deleted. Moved functionality to iCILabel().
    • +ciLabel(): Deleted. Moved functionality to iCILabel().
    • getAllDependencies(): Deleted. Moved functionality to iGetAllDependencies() and moved code to swvUtils file.
    • @@ -2209,23 +2213,23 @@

    • getMainTitle(): Deleted. Moved functionality to iGetMainTitle() and moved code to residPlot() file.
    • -getVarFromFormula(): Deleted. Moved functionality to iGetVarFromFormula().
    • +getVarFromFormula(): Deleted. Moved functionality to iGetVarFromFormula().

    • -hndlFormula(): Deleted. Moved functionality to iHndlFormula().
    • +hndlFormula(): Deleted. Moved functionality to iHndlFormula().
    • -hndlMultWhat(): Deleted. Moved functionality to iHndlMultWhat().
    • +hndlMultWhat(): Deleted. Moved functionality to iHndlMultWhat().
    • -iAddLoessLine(): Added. Was addLoessLine().
    • +iAddLoessLine(): Added. Was addLoessLine().
    • iAddOutlierTestResults(): Added. Was addOutlierTestResults().
    • -iCheckStartcatW(): Added. Was checkStartcatW().
    • +iCheckStartcatW(): Added. Was checkStartcatW().
    • iCIfp(): Added. Was ci.fp().
    • iCIfp1(): Added. Was ci.fp.1().
    • -iCILabel(): Added. Was ciLabel().
    • +iCILabel(): Added. Was ciLabel().
    • iGetAllDependencies(): Added. Was getAllDependencies().
    • @@ -2233,15 +2237,15 @@

    • iGetMainTitle(): Added. Was getMainTitle().
    • -iGetVarFromFormula(): Added. Was getVarFromFormula().
    • +iGetVarFromFormula(): Added. Was getVarFromFormula().

    • -iHndlFormula(): Added. Was hndlFormula().
    • +iHndlFormula(): Added. Was hndlFormula().
    • -iHndlMultWhat(): Added. Was hndlMultWhat().
    • +iHndlMultWhat(): Added. Was hndlMultWhat().
    • -iLegendHelp(): Added. Was legendHelp().
    • +iLegendHelp(): Added. Was legendHelp().
    • -iMakeColor(): Added. Was makeColor().
    • +iMakeColor(): Added. Was makeColor().
    • iMakeFilename(): Added. Was makeFilename().
    • @@ -2255,16 +2259,16 @@

    • is.odd(): Added. Was odd().
    • -iTypeoflm(): Added. Was typeoflm().
    • +iTypeoflm(): Added. Was typeoflm().

    • iwsLitCheck(): Added. Was wsLitCheck()
    • -legendHelp(): Deleted. Moved functionality to iLegendHelp().
    • +legendHelp(): Deleted. Moved functionality to iLegendHelp().
    • -listSpecies(): Deleted. Moved functionality to iListSpecies().
    • +listSpecies(): Deleted. Moved functionality to iListSpecies().
    • -makeColor(): Deleted. Moved functionality to iMakeColor().
    • +makeColor(): Deleted. Moved functionality to iMakeColor().
    • makeFilename(): Deleted. Moved functionality to iMakeFilename() and moved code to swvUtils file.
    • @@ -2272,7 +2276,7 @@

    • odd(): Deleted. Moved functionality to is.odd().
    • -predict.nlsBoot(): Added an interactive() to the nlstools example in the help file.
    • +predict.nlsBoot(): Added an interactive() to the nlstools example in the help file.

    • printProgressMsg(): Deleted. Not used anywhere.
    • @@ -2288,7 +2292,7 @@

    • pssVal(): Deleted. Was deprecated several versions ago. See psdVal().
    • -typeoflm(): Deleted. Moved functionality to iTypeoflm().
    • +typeoflm(): Deleted. Moved functionality to iTypeoflm().

    • wsLitCheck(): Deleted. Moved functionality to iwsLitCheck() and moved code to wsVals() file.
    @@ -2301,7 +2305,7 @@

  • added tests (in test_VonB2b.R) to assure that group comparisons of von Bertalanffy parameters equal those in Kimura (1980) and vblrt() in fishmethods.
  • added importsFrom for lmtest for lrt(). Also used in testing (test_VonB2b.R).
  • -confint.nlsBoot(): Modified. Modified the plotting to use hist.formula(), removed par(mar=) definitions, and added err.col= and lwd.col= to control the color and line width of the confidence interval line on the plot.
  • +confint.nlsBoot(): Modified. Modified the plotting to use hist.formula(), removed par(mar=) definitions, and added err.col= and lwd.col= to control the color and line width of the confidence interval line on the plot.
  • extraSS(): Added.
  • @@ -2360,7 +2364,7 @@

  • agePrecision(): Modified. Removed deprecated what="agreement".
  • -confint.nlsBoot(): Modified. Changed example from “dont run” to “interactive.”
  • +confint.nlsBoot(): Modified. Changed example from “dont run” to “interactive.”

  • fact2num(): Modified. Changed example from “dont run” to “interactive.”
  • @@ -2372,7 +2376,7 @@

  • growthRadPlot(): Modified. Changed example from “dont run” to “interactive.”
  • -htest.nlsBoot(): Modified. Changed example from “dont run” to “interactive.”
  • +htest.nlsBoot(): Modified. Changed example from “dont run” to “interactive.”

  • lagratio(): Modified. Changed example from “dont run” to “interactive.”
  • @@ -2393,14 +2397,14 @@

    • Removed Roxygen directives in DESCRIPTION (with changes to roxygen2 4.0.1).

    • -
    • Changed @S3method and @method to @export in the following files according to changes in ROxygen2 as described here, among several other places: ageBias, agePrecision, bootCase, catchCurve, chapmanRobson, confint.nlsboot, depletion, dietOverlap, fitPlot, hist.formula, htest.nlsBoot, ks2d1, ks2d1p, ks2d2, ks2d2p, ksTest, lencat, mrClosed, mrOpen, plotBinResp, predict.nlsBoot, removal, residPlot, srStarts, Subset, Summarize, sumTable, vbStarts, and walfordChapmanPlot.

    • +
    • Changed @S3method and @method to @export in the following files according to changes in ROxygen2 as described here, among several other places: ageBias, agePrecision, bootCase, catchCurve, chapmanRobson, confint.nlsboot, depletion, dietOverlap, fitPlot, hist.formula, htest.nlsBoot, ks2d1, ks2d1p, ks2d2, ks2d2p, ksTest, lencat, mrClosed, mrOpen, plotBinResp, predict.nlsBoot, removal, residPlot, srStarts, Subset, Summarize, sumTable, vbStarts, and walfordChapmanPlot.

    • addZeroCatch(): Modified. Added a catch for the situation where no zeros need to be added to the data.frame. Cleaned-up the help file, modified the examples, and added another example. Thanks to Ben Neely for bringing this bug (handling where zeros are not needed) to my attention.

    • capHistSum(): Modified. Cleaned up the code (no changes in functionality).

    • catchCurveSim(): Deleted. Moved to FSAsim package.

    • checkstartcatw(): Modified. Changed the catch for whether the starting category value was greater than the minimum observed value to correct for a pathological case where they were equal but not with machine rounding.

    • lenFreqExpand(): Modified. Slightly changed the examples in the help file.

    • lwPredsComp(): Modified. Streamlined the code (no changes to functionality).

    • -
    • mrOpen(): Modified. Streamlined the code (no changes to functionality). Removed all explicity partial matching options in switch()es as these were already caught with previous match.arg()s.

    • +
    • mrOpen(): Modified. Streamlined the code (no changes to functionality). Removed all explicity partial matching options in switch()es as these were already caught with previous match.arg()s.

  • @@ -2472,7 +2476,7 @@

    @@ -2717,8 +2721,8 @@

  • Corrected all pointers to fishR vignettes (because of new webpage).

  • Removed importFrom color.scale from plotrix because of changes to discharge() and wetPerim().

  • removed importFrom %nin% from Hmisc. See multiple changes because of this below.

  • -
  • .onAttach(): Added, was .onLoad().

  • -
  • .onLoad(): Deleted, now .onAttach().

  • +
  • .onAttach(): Added, was .onLoad().

  • +
  • .onLoad(): Deleted, now .onAttach().

  • addMargins(): Deleted, moved back to NCStats.

  • addSigLetters(): Deleted, moved back to NCStats.

  • addZeroCatch(): Modified. Changed the looping structure for finding the sampling event and species combinations that need zeros. This should speed things up substantially. Also, modified to allow no idvar= variables. Finally, the returned data frame has the variables (columns) in the same order as the original data frame (rather than having the order modified).

  • @@ -2728,17 +2732,17 @@

  • capFirst(): Modified so that ONLY the first letter is capitalized (previous version would de-capitalize the first letter in the second word but leave the rest of the letters capitalized).

  • capHistSum(): Modified to correct an error that occurred when computing the Method B table when a capture history occurred only once or not at all.

  • chapmanRobson(): Modified by adding the Hoenig et al. (1983) bias correction formula for the estimate of Z as the default option.

  • -
  • confint.nlsBoot(): Removed use of %nin%.

  • +
  • confint.nlsBoot(): Removed use of %nin%.

  • discharge(): Deleted, moved to NCStats (to reduce overhead here).

  • -
  • histStack(): Modified by adding a formula method (histStack.formula()) which required adding a default method (histStack.default()).

  • -
  • htest.nlsBoot(): Removed use of %nin%.

  • +
  • histStack(): Modified by adding a formula method (histStack.formula()) which required adding a default method (histStack.default()).

  • +
  • htest.nlsBoot(): Removed use of %nin%.

  • lencat(): Modified by changing to using a formula notation and a data= argument. This means that the df= and cl= arguments are no longer used. In addition, the warning about fish larger than the larger category has been turned off. The method to handle this was not changed, the warning was just turned off.

  • lencatOLD(): Added as an internal file to temporarily allow me not to change all functions that were affected by the changes to lencat(). The functions that required this are emp() and wsValidate().

  • lenFreqExpand(): Modified to deal with lencat() change.

  • limnoProfilePlot(): Deleted, moved to NCStats (to reduce overhead here).

  • mrClosed(): Removed use of %nin%.

  • plotBinResp(): Modified by moving makeColor() internal function to FSA-internals so that it can also be used by tictactoe().

  • -
  • predict.bootCase(): Added.

  • +
  • predict.bootCase(): Added.

  • PSSLit: added from RSDLit. Added from Ogle and Winfield (2009) for ruffe, Bonvechio et al. (2010) for Suwannee bass, and from Phelps and Willis (2013) for several “carp” species.

  • PSSLitCheck(): Added this internal file. Modified pssVal(), pssCalc(), and pssPlot() accordingly.

  • psdVal(): Deprecated, will delete, became pssVal().

  • @@ -3374,7 +3378,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/pkgdown.css b/docs/pkgdown.css index c01e5923..1273238d 100644 --- a/docs/pkgdown.css +++ b/docs/pkgdown.css @@ -244,14 +244,14 @@ nav[data-toggle='toc'] .nav .nav > .active:focus > a { .ref-index th {font-weight: normal;} -.ref-index td {vertical-align: top;} +.ref-index td {vertical-align: top; min-width: 100px} .ref-index .icon {width: 40px;} .ref-index .alias {width: 40%;} .ref-index-icons .alias {width: calc(40% - 40px);} .ref-index .title {width: 60%;} .ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} .ref-arguments .name {width: 20%;} .ref-arguments .desc {width: 80%;} diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 716a4e7c..df75ee34 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,8 +1,8 @@ pandoc: 2.7.3 -pkgdown: 1.5.1 +pkgdown: 1.6.1 pkgdown_sha: ~ -articles: [] -last_built: 2020-08-24T11:49Z +articles: {} +last_built: 2020-11-08T03:37Z urls: reference: http://derekogle.com/FSA/reference article: http://derekogle.com/FSA/articles diff --git a/docs/reference/BluegillJL.html b/docs/reference/BluegillJL.html index d34b0a99..18ca2c58 100644 --- a/docs/reference/BluegillJL.html +++ b/docs/reference/BluegillJL.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -132,7 +132,7 @@

    Capture histories (2 samples) of Bluegill from Jewett Lake, MI.

    Format

    -

    A data frame with 277 observations on the following 2 variables.

    +

    A data frame with 277 observations on the following 2 variables.

    first

    a numeric vector of indicator variables for the first sample (1=captured)

    second

    a numeric vector of indicator variables for the second sample (1=captured)

    @@ -159,9 +159,11 @@

    See a

    Used in mrClosed examples.

    Examples

    -
    str(BluegillJL)
    #> 'data.frame': 277 obs. of 2 variables: +
    str(BluegillJL) +
    #> 'data.frame': 277 obs. of 2 variables: #> $ first : int 1 0 1 0 1 1 1 1 1 1 ... -#> $ second: int 0 1 0 1 0 0 0 0 0 0 ...
    head(BluegillJL)
    #> first second +#> $ second: int 0 1 0 1 0 0 0 0 0 0 ...
    head(BluegillJL) +
    #> first second #> 1 1 0 #> 2 0 1 #> 3 1 0 @@ -184,7 +186,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/BrookTroutTH-1.png b/docs/reference/BrookTroutTH-1.png index 042376a7..6b1c5ea9 100644 Binary files a/docs/reference/BrookTroutTH-1.png and b/docs/reference/BrookTroutTH-1.png differ diff --git a/docs/reference/BrookTroutTH.html b/docs/reference/BrookTroutTH.html index f7023fbf..afc46290 100644 --- a/docs/reference/BrookTroutTH.html +++ b/docs/reference/BrookTroutTH.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -132,7 +132,7 @@

    Catch-at-age for Tobin Harbor, Isle Royale Brook Trout.

    Format

    -

    A data frame with 7 observations on the following 2 variables.

    +

    A data frame with 7 observations on the following 2 variables.

    age

    A numeric vector of assigned ages

    catch

    A numeric vector of number of Brook Trout caught

    @@ -156,15 +156,18 @@

    See a

    Used in catchCurve and chapmanRobson examples.

    Examples

    -
    str(BrookTroutTH)
    #> 'data.frame': 7 obs. of 2 variables: +
    str(BrookTroutTH) +
    #> 'data.frame': 7 obs. of 2 variables: #> $ age : int 0 1 2 3 4 5 6 -#> $ catch: int 39 93 112 45 58 12 8
    head(BrookTroutTH)
    #> age catch +#> $ catch: int 39 93 112 45 58 12 8
    head(BrookTroutTH) +
    #> age catch #> 1 0 39 #> 2 1 93 #> 3 2 112 #> 4 3 45 #> 5 4 58 -#> 6 5 12
    plot(log(catch)~age,data=BrookTroutTH)
    +#> 6 5 12
    plot(log(catch)~age,data=BrookTroutTH) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/ChinookArg-1.png b/docs/reference/ChinookArg-1.png index 86d9be31..c2060267 100644 Binary files a/docs/reference/ChinookArg-1.png and b/docs/reference/ChinookArg-1.png differ diff --git a/docs/reference/ChinookArg.html b/docs/reference/ChinookArg.html index 4a23875e..8ecfc039 100644 --- a/docs/reference/ChinookArg.html +++ b/docs/reference/ChinookArg.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -132,7 +132,7 @@

    Lengths and weights for Chinook Salmon from three locations in Argentina.Format

    -

    A data frame with 112 observations on the following 3 variables:

    +

    A data frame with 112 observations on the following 3 variables:

    tl

    Total length (cm)

    w

    Weight (kg)

    loc

    Capture location (Argentina, Petrohue, Puyehue)

    @@ -155,20 +155,23 @@

    See a

    Used in lwCompPreds examples.

    Examples

    -
    str(ChinookArg)
    #> 'data.frame': 112 obs. of 3 variables: +
    str(ChinookArg) +
    #> 'data.frame': 112 obs. of 3 variables: #> $ tl : num 120 115 111 110 110 ... #> $ w : num 17.9 17.2 16.8 15.8 14.3 13.8 12.8 11.7 12.8 14.8 ... -#> $ loc: Factor w/ 3 levels "Argentina","Petrohue",..: 1 1 1 1 1 1 1 1 1 1 ...
    head(ChinookArg)
    #> tl w loc +#> $ loc: Factor w/ 3 levels "Argentina","Petrohue",..: 1 1 1 1 1 1 1 1 1 1 ...
    head(ChinookArg) +
    #> tl w loc #> 1 120.1 17.9 Argentina #> 2 115.0 17.2 Argentina #> 3 111.2 16.8 Argentina #> 4 110.2 15.8 Argentina #> 5 110.0 14.3 Argentina -#> 6 109.7 13.8 Argentina
    op <- par(mfrow=c(2,2),pch=19,mar=c(3,3,0.5,0.5),mgp=c(1.9,0.5,0),tcl=-0.2) -plot(w~tl,data=ChinookArg,subset=loc=="Argentina") -plot(w~tl,data=ChinookArg,subset=loc=="Petrohue") -plot(w~tl,data=ChinookArg,subset=loc=="Puyehue") -par(op)
    +#> 6 109.7 13.8 Argentina
    op <- par(mfrow=c(2,2),pch=19,mar=c(3,3,0.5,0.5),mgp=c(1.9,0.5,0),tcl=-0.2) +plot(w~tl,data=ChinookArg,subset=loc=="Argentina") +plot(w~tl,data=ChinookArg,subset=loc=="Petrohue") +plot(w~tl,data=ChinookArg,subset=loc=="Puyehue") +par(op) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/CodNorwegian-1.png b/docs/reference/CodNorwegian-1.png index 3d63b5e8..b75f62db 100644 Binary files a/docs/reference/CodNorwegian-1.png and b/docs/reference/CodNorwegian-1.png differ diff --git a/docs/reference/CodNorwegian.html b/docs/reference/CodNorwegian.html index 63376cca..342be2ed 100644 --- a/docs/reference/CodNorwegian.html +++ b/docs/reference/CodNorwegian.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -132,7 +132,7 @@

    Stock and recruitment data for Norwegian cod, 1937-1960.

    Format

    -

    A data frame of 24 observations on the following 3 variables:

    +

    A data frame of 24 observations on the following 3 variables:

    year

    Year of data

    recruits

    Recruits -- year-class strength index

    stock

    Spawning stock index

    @@ -156,18 +156,23 @@

    See a

    Used in srStarts, srFuns, and nlsTracePlot examples.

    Examples

    -
    str(CodNorwegian)
    #> 'data.frame': 24 obs. of 3 variables: +
    str(CodNorwegian) +
    #> 'data.frame': 24 obs. of 3 variables: #> $ year : int 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 ... #> $ recruits: int 146 31 17 26 43 58 113 75 99 70 ... -#> $ stock : int 118 164 180 172 151 139 122 114 139 140 ...
    head(CodNorwegian)
    #> year recruits stock +#> $ stock : int 118 164 180 172 151 139 122 114 139 140 ...
    head(CodNorwegian) +
    #> year recruits stock #> 1 1937 146 118 #> 2 1938 31 164 #> 3 1939 17 180 #> 4 1940 26 172 #> 5 1941 43 151 -#> 6 1942 58 139
    op <- par(mfrow=c(1,2),pch=19,mar=c(3,3,0.5,0.5),mgp=c(1.9,0.5,0),tcl=-0.2) -plot(recruits~year,data=CodNorwegian,type="l") -plot(recruits~stock,data=CodNorwegian)
    par(op)
    +#> 6 1942 58 139
    op <- par(mfrow=c(1,2),pch=19,mar=c(3,3,0.5,0.5),mgp=c(1.9,0.5,0),tcl=-0.2) +plot(recruits~year,data=CodNorwegian,type="l") +plot(recruits~stock,data=CodNorwegian) +
    par(op) + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/CutthroatAL.html b/docs/reference/CutthroatAL.html index 74d49ebe..5867f94b 100644 --- a/docs/reference/CutthroatAL.html +++ b/docs/reference/CutthroatAL.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -132,7 +132,7 @@

    Capture histories (9 samples) of Cutthroat Trout from Auke Lake.

    Format

    -

    A data frame with 1684 observations on the following 10 variables.

    +

    A data frame with 1684 observations on the following 10 variables.

    id

    Unique identification numbers for each fish

    y1998

    Indicator variable for whether the fish was captured in 1998 (1=captured)

    y1999

    Indicator variable for whether the fish was captured in 1999 (1=captured)

    @@ -167,10 +167,11 @@

    Topic

    See also

    -

    Used in mrOpen examples.

    +

    Used in mrOpen examples.

    Examples

    -
    str(CutthroatAL)
    #> 'data.frame': 1684 obs. of 10 variables: +
    str(CutthroatAL) +
    #> 'data.frame': 1684 obs. of 10 variables: #> $ id : int 1 2 3 4 5 6 7 8 9 10 ... #> $ y1998: int 0 0 0 0 0 0 0 0 0 0 ... #> $ y1999: int 0 0 0 0 0 0 0 0 0 0 ... @@ -180,7 +181,8 @@

    Examp #> $ y2003: int 0 0 0 0 0 0 0 0 0 0 ... #> $ y2004: int 0 0 0 0 0 0 0 0 0 0 ... #> $ y2005: int 0 0 0 0 0 0 0 0 0 0 ... -#> $ y2006: int 1 1 1 1 1 1 1 1 1 1 ...

    head(CutthroatAL)
    #> id y1998 y1999 y2000 y2001 y2002 y2003 y2004 y2005 y2006 +#> $ y2006: int 1 1 1 1 1 1 1 1 1 1 ...
    head(CutthroatAL) +
    #> id y1998 y1999 y2000 y2001 y2002 y2003 y2004 y2005 y2006 #> 1 1 0 0 0 0 0 0 0 0 1 #> 2 2 0 0 0 0 0 0 0 0 1 #> 3 3 0 0 0 0 0 0 0 0 1 @@ -203,7 +205,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Ecoli.html b/docs/reference/Ecoli.html index b77ff3fb..b03fd038 100644 --- a/docs/reference/Ecoli.html +++ b/docs/reference/Ecoli.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -132,7 +132,7 @@

    Population growth of Escherichia coli.

    Format

    -

    A data frame with 8 observations on the following 2 variables:

    +

    A data frame with 8 observations on the following 2 variables:

    days

    Elapsed duration of the experiment

    cells

    Number of cells in the population

    @@ -152,7 +152,7 @@

    Topic

    See also

    -

    Used in bootCase and fitPlot examples.

    +

    Used in bootCase and fitPlot examples.

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/FSA-internals.html b/docs/reference/FSA-internals.html index a0be5897..ca7eabac 100644 --- a/docs/reference/FSA-internals.html +++ b/docs/reference/FSA-internals.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Internal functions.

    Internal functions that are common to several functions in FSA.

    -
    .onAttach(lib, pkg, ...)
    +
    .onAttach(lib, pkg, ...)
    @@ -147,7 +147,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/FSA.html b/docs/reference/FSA.html index f24f60ea..735c8ac7 100644 --- a/docs/reference/FSA.html +++ b/docs/reference/FSA.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -133,16 +133,16 @@

    Fisheries stock assessment methods and data.

    Details

    Functions from this package can be used to perform a variety of basic fisheries stock assessment methods. Detailed descriptions for most functions are available in the Introductory Fisheries Analysis with R book (Ogle 2016). Vignettes for the boxed examples in the “Analysis and Interpretation of Freshwater Fisheries Data” book can be viewed with fishR("AIFFD").

    -

    Questions, comments, or suggestions should be given on the GitHub FSA Issues page.

    +

    Questions, comments, or suggestions should be given on the GitHub FSA Issues page.

    Packages with related functionality by the same author are

      -
    • The FSAdata package contains additional data sets.

    • -
    • The FSAsim package simulation routines for various fisheries methods.

    • -
    • The FSAWs package contains functions for developing and validating standard weight equations.

    • +
    • The FSAdata package contains additional data sets.

    • +
    • The FSAsim package simulation routines for various fisheries methods.

    • +
    • The FSAWs package contains functions for developing and validating standard weight equations.

    References

    -

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

    +

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

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/FSAUtils.html b/docs/reference/FSAUtils.html index 3042e65e..df05a737 100644 --- a/docs/reference/FSAUtils.html +++ b/docs/reference/FSAUtils.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Capitalizes the first letter of first or all words in a string.

    Capitalizes the first letter of first or all words in a string.

    -
    capFirst(x, which = c("all", "first"))
    +
    capFirst(x, which = c("all", "first"))

    Arguments

    @@ -146,19 +146,33 @@

    Arg

    Value

    A single string with the first letter of the first or all words capitalized.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Capitalize first letter of all words (the default) -capFirst("Derek Ogle")
    #> [1] "Derek Ogle"
    capFirst("derek ogle")
    #> [1] "Derek Ogle"
    capFirst("derek")
    #> [1] "Derek"
    +capFirst("Derek Ogle") +
    #> [1] "Derek Ogle"
    capFirst("derek ogle") +
    #> [1] "Derek Ogle"
    capFirst("derek") +
    #> [1] "Derek"
    ## Capitalize first letter of only the first words -capFirst("Derek Ogle",which="first")
    #> [1] "Derek ogle"
    capFirst("derek ogle",which="first")
    #> [1] "Derek ogle"
    capFirst("derek",which="first")
    #> [1] "Derek"
    ## apply to all elements in a vector -vec <- c("Derek Ogle","derek ogle","Derek ogle","derek Ogle","DEREK OGLE") -capFirst(vec)
    #> [1] "Derek Ogle" "Derek Ogle" "Derek Ogle" "Derek Ogle" "Derek Ogle"
    capFirst(vec,which="first")
    #> [1] "Derek ogle" "Derek ogle" "Derek ogle" "Derek ogle" "Derek ogle"
    +capFirst("Derek Ogle",which="first") +
    #> [1] "Derek ogle"
    capFirst("derek ogle",which="first") +
    #> [1] "Derek ogle"
    capFirst("derek",which="first") +
    #> [1] "Derek"
    ## apply to all elements in a vector +vec <- c("Derek Ogle","derek ogle","Derek ogle","derek Ogle","DEREK OGLE") +capFirst(vec) +
    #> [1] "Derek Ogle" "Derek Ogle" "Derek Ogle" "Derek Ogle" "Derek Ogle"
    capFirst(vec,which="first") +
    #> [1] "Derek ogle" "Derek ogle" "Derek ogle" "Derek ogle" "Derek ogle"
    ## check class types -class(vec)
    #> [1] "character"
    vec1 <- capFirst(vec) -class(vec1)
    #> [1] "character"
    fvec <- factor(vec) -fvec1 <- capFirst(fvec) -class(fvec1)
    #> [1] "factor"
    +class(vec) +
    #> [1] "character"
    vec1 <- capFirst(vec) +class(vec1) +
    #> [1] "character"
    fvec <- factor(vec) +fvec1 <- capFirst(fvec) +class(fvec1) +
    #> [1] "factor"
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Mirex.html b/docs/reference/Mirex.html index 0f04d110..c6f905fb 100644 --- a/docs/reference/Mirex.html +++ b/docs/reference/Mirex.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -132,7 +132,7 @@

    Mirex concentration, weight, capture year, and species of Lake Ontario salmo

    Format

    -

    A data frame with 122 observations on the following 4 variables.

    +

    A data frame with 122 observations on the following 4 variables.

    year

    a numeric vector of capture years

    weight

    a numeric vector of salmon weights (kg)

    mirex

    a numeric vector of mirex concentration in the salmon tissue (mg/kg)

    @@ -160,9 +160,10 @@

    See a

    Examples

    -
    Mirex$year <- factor(Mirex$year) -lm1 <- lm(mirex~weight*year*species,data=Mirex) -anova(lm1)
    #> Analysis of Variance Table +
    Mirex$year <- factor(Mirex$year) +lm1 <- lm(mirex~weight*year*species,data=Mirex) +anova(lm1) +
    #> Analysis of Variance Table #> #> Response: mirex #> Df Sum Sq Mean Sq F value Pr(>F) @@ -192,7 +193,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/PSDlit.html b/docs/reference/PSDlit.html index 14a95e24..6b7944a1 100644 --- a/docs/reference/PSDlit.html +++ b/docs/reference/PSDlit.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -132,7 +132,7 @@

    Gabelhouse five-cell length categories for various species.

    Format

    -

    A data frame of 58 observations on the following 11 variables:

    +

    A data frame of 58 observations on the following 11 variables:

    species

    Species name.

    stock.in

    Stock length in inches.

    quality.in

    Quality length in inches.

    @@ -166,13 +166,14 @@

    <

    6-Size Structure.

    References

    -

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

    +

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

    See also

    See psdVal, psdCalc, psdPlot, psdAdd, and tictactoe for related functionality.

    Examples

    -
    str(PSDlit)
    #> 'data.frame': 63 obs. of 11 variables: +
    str(PSDlit) +
    #> 'data.frame': 63 obs. of 11 variables: #> $ species : Factor w/ 63 levels "Arctic Grayling",..: 1 2 3 4 5 6 7 8 10 11 ... #> $ stock.in : num 8 11.8 11 6 15.8 ... #> $ quality.in : num 12 21.2 18 9 28.2 ... @@ -183,7 +184,8 @@

    Examp #> $ quality.cm : int 30 54 46 23 72 20 51 15 33 20 ... #> $ preferred.cm: int 40 68 61 30 90 25 76 20 NA NA ... #> $ memorable.cm: int 50 89 76 39 118 30 89 25 NA NA ... -#> $ trophy.cm : num 55 111 94 46 148 38 114 30 NA NA ...

    head(PSDlit)
    #> species stock.in quality.in preferred.in memorable.in trophy.in +#> $ trophy.cm : num 55 111 94 46 148 38 114 30 NA NA ...
    head(PSDlit) +
    #> species stock.in quality.in preferred.in memorable.in trophy.in #> 1 Arctic Grayling 8.00 12.00 16.00 20.0 22.00 #> 2 Bighead Carp 11.75 21.25 26.75 35.0 43.75 #> 3 Bigmouth Buffalo 11.00 18.00 24.00 30.0 37.00 @@ -213,7 +215,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/PikeNY.html b/docs/reference/PikeNY.html index c4431773..224a781c 100644 --- a/docs/reference/PikeNY.html +++ b/docs/reference/PikeNY.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -132,7 +132,7 @@

    Summarized multiple mark-recapture data for all Northern Pike from Buckhorn

    Format

    -

    A data frame with 21 observations on the following 4 variables:

    +

    A data frame with 21 observations on the following 4 variables:

    date

    Capture date

    n

    Total fish captured in each sample

    m

    Marked fish captured in each sample

    @@ -161,11 +161,13 @@

    See a

    Used in mrClosed examples. Also see PikeNYPartial1.

    Examples

    -
    str(PikeNY)
    #> 'data.frame': 21 obs. of 4 variables: +
    str(PikeNY) +
    #> 'data.frame': 21 obs. of 4 variables: #> $ date: Factor w/ 21 levels "1-Apr","1-May",..: 15 16 19 20 1 12 17 21 3 4 ... #> $ n : int 2 3 2 3 20 18 14 9 17 6 ... #> $ m : int 0 0 0 0 2 3 4 4 14 5 ... -#> $ R : int 2 3 2 3 20 18 13 9 17 6 ...
    head(PikeNY)
    #> date n m R +#> $ R : int 2 3 2 3 20 18 13 9 17 6 ...
    head(PikeNY) +
    #> date n m R #> 1 28-Mar 2 0 2 #> 2 29-Mar 3 0 3 #> 3 30-Mar 2 0 2 @@ -188,7 +190,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/PikeNYPartial1.html b/docs/reference/PikeNYPartial1.html index 89125c17..2e98f3c9 100644 --- a/docs/reference/PikeNYPartial1.html +++ b/docs/reference/PikeNYPartial1.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -132,7 +132,7 @@

    Capture histories (4 samples), in capture history format, of a subset of Nor

    Format

    -

    A data frame with 57 observations on the following 4 variables.

    +

    A data frame with 57 observations on the following 4 variables.

    id

    A unique identification numbers

    first

    Indicator variable for the first sample (1=captured)

    second

    Indicator variable for the second sample (1=captured)

    @@ -163,12 +163,14 @@

    See a

    Used in capHistSum and mrClosed examples. Also see PikeNY.

    Examples

    -
    str(PikeNYPartial1)
    #> 'data.frame': 57 obs. of 5 variables: +
    str(PikeNYPartial1) +
    #> 'data.frame': 57 obs. of 5 variables: #> $ id : int 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 ... #> $ first : int 1 1 1 1 1 1 1 1 1 1 ... #> $ second: int 0 0 0 0 0 0 0 0 0 0 ... #> $ third : int 0 0 0 0 0 0 0 0 0 0 ... -#> $ fourth: int 0 0 0 0 0 0 0 0 0 0 ...
    head(PikeNYPartial1)
    #> id first second third fourth +#> $ fourth: int 0 0 0 0 0 0 0 0 0 0 ...
    head(PikeNYPartial1) +
    #> id first second third fourth #> 1 2001 1 0 0 0 #> 2 2002 1 0 0 0 #> 3 2003 1 0 0 0 @@ -191,7 +193,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/SMBassLS.html b/docs/reference/SMBassLS.html index 008b05e8..fcb5c8c5 100644 --- a/docs/reference/SMBassLS.html +++ b/docs/reference/SMBassLS.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -132,7 +132,7 @@

    Catch-effort data for Little Silver Lake (Ont) Smallmouth Bass.

    Format

    -

    A data frame with 10 observations on the following 3 variables:

    +

    A data frame with 10 observations on the following 3 variables:

    day

    Day of the catch

    catch

    Number of smallmouth bass caught

    effort

    Number of traps set per day

    @@ -160,10 +160,12 @@

    See a

    Used in depletion examples.

    Examples

    -
    str(SMBassLS)
    #> 'data.frame': 10 obs. of 3 variables: +
    str(SMBassLS) +
    #> 'data.frame': 10 obs. of 3 variables: #> $ day : int 1 2 3 4 5 6 7 8 9 10 #> $ catch : int 131 69 99 78 56 76 49 42 63 47 -#> $ effort: int 7 7 7 7 7 7 7 7 7 7
    head(SMBassLS)
    #> day catch effort +#> $ effort: int 7 7 7 7 7 7 7 7 7 7
    head(SMBassLS) +
    #> day catch effort #> 1 1 131 7 #> 2 2 69 7 #> 3 3 99 7 @@ -186,7 +188,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/SMBassWB.html b/docs/reference/SMBassWB.html index 1b653f3e..7f22ca6e 100644 --- a/docs/reference/SMBassWB.html +++ b/docs/reference/SMBassWB.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -132,7 +132,7 @@

    Growth increment data for West Bearskin Lake, MN, Smallmouth Bass.

    Format

    -

    A data frame of 445 observations on the following 20 variables:

    +

    A data frame of 445 observations on the following 20 variables:

    species

    Species of the fish (SMB for each fish in this file)

    lake

    Lake fish was captured in (WB for each fish in this file)

    gear

    Gear used to capture the fish (T=Trapnet and E=Electrofishing)

    @@ -177,7 +177,8 @@

    See a

    Used in capHistSum and mrClosed examples. Also see wblake from alr4 for the same dataset with only the agecap, lencap, and radcap variables.

    Examples

    -
    str(SMBassWB)
    #> 'data.frame': 445 obs. of 20 variables: +
    str(SMBassWB) +
    #> 'data.frame': 445 obs. of 20 variables: #> $ species: Factor w/ 1 level "SMB": 1 1 1 1 1 1 1 1 1 1 ... #> $ lake : Factor w/ 1 level "WB": 1 1 1 1 1 1 1 1 1 1 ... #> $ gear : Factor w/ 2 levels "E","T": 1 1 1 1 1 1 1 1 1 1 ... @@ -197,7 +198,8 @@

    Examp #> $ anu10 : num NA NA NA NA NA NA NA NA NA NA ... #> $ anu11 : num NA NA NA NA NA NA NA NA NA NA ... #> $ anu12 : num NA NA NA NA NA NA NA NA NA NA ... -#> $ radcap : num 1.91 1.88 1.1 1.33 1.59 ...

    head(SMBassWB)
    #> species lake gear yearcap fish agecap lencap anu1 anu2 anu3 anu4 anu5 anu6 +#> $ radcap : num 1.91 1.88 1.1 1.33 1.59 ...
    head(SMBassWB) +
    #> species lake gear yearcap fish agecap lencap anu1 anu2 anu3 anu4 anu5 anu6 #> 1 SMB WB E 1988 5 1 71 1.90606 NA NA NA NA NA #> 2 SMB WB E 1988 3 1 64 1.87707 NA NA NA NA NA #> 3 SMB WB E 1988 2 1 57 1.09227 NA NA NA NA NA @@ -227,7 +229,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Schnute-1.png b/docs/reference/Schnute-1.png index 0914ace5..7af04329 100644 Binary files a/docs/reference/Schnute-1.png and b/docs/reference/Schnute-1.png differ diff --git a/docs/reference/Schnute-2.png b/docs/reference/Schnute-2.png index 077d6a2e..ba316c3c 100644 Binary files a/docs/reference/Schnute-2.png and b/docs/reference/Schnute-2.png differ diff --git a/docs/reference/Schnute-3.png b/docs/reference/Schnute-3.png index b4ab5771..e3857dae 100644 Binary files a/docs/reference/Schnute-3.png and b/docs/reference/Schnute-3.png differ diff --git a/docs/reference/Schnute-4.png b/docs/reference/Schnute-4.png index 28bdef61..ca6ed032 100644 Binary files a/docs/reference/Schnute-4.png and b/docs/reference/Schnute-4.png differ diff --git a/docs/reference/Schnute-5.png b/docs/reference/Schnute-5.png index 2bd84b71..242fd75b 100644 Binary files a/docs/reference/Schnute-5.png and b/docs/reference/Schnute-5.png differ diff --git a/docs/reference/Schnute.html b/docs/reference/Schnute.html index d2df3bca..e17b9607 100644 --- a/docs/reference/Schnute.html +++ b/docs/reference/Schnute.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -128,16 +128,16 @@

    The four-parameter growth function from Schnute (1981).

    The four-parameter growth function from Schnute (1981).

    -
    Schnute(
    -  t,
    -  case = 1,
    -  t1 = NULL,
    -  t3 = NULL,
    -  L1 = NULL,
    -  L3 = NULL,
    -  a = NULL,
    -  b = NULL
    -)
    +
    Schnute(
    +  t,
    +  case = 1,
    +  t1 = NULL,
    +  t3 = NULL,
    +  L1 = NULL,
    +  L3 = NULL,
    +  a = NULL,
    +  b = NULL
    +)

    Arguments

    @@ -188,10 +188,14 @@

    R

    See also

    See vbFuns, GompertzFuns, RichardsFuns, logisticFuns, and SchnuteRichards for similar functionality for other models.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## See the formulae -growthFunShow("Schnute",1,plot=TRUE)
    #> expression(E(L[t]) == bgroup("[", L[1]^{ +growthFunShow("Schnute",1,plot=TRUE) +
    #> expression(E(L[t]) == bgroup("[", L[1]^{ #> b #> } + (L[3]^{ #> b @@ -203,13 +207,15 @@

    Examp #> -a * (~t[3] ~ -~t[1]) #> }), "]")^{ #> ~frac(1, b) -#> })

    growthFunShow("Schnute",2,plot=TRUE)
    #> expression(E(L[t]) == L[1] * e^{ +#> })
    growthFunShow("Schnute",2,plot=TRUE) +
    #> expression(E(L[t]) == L[1] * e^{ #> log ~ bgroup("(", frac(L[3], L[1]), ")") * ~frac(1 - e^{ #> -a * (~t ~ -~t[1]) #> }, 1 - e^{ #> -a * (~t[3] ~ -~t[1]) #> }) -#> })
    growthFunShow("Schnute",3,plot=TRUE)
    #> expression(E(L[t]) == bgroup("[", L[1]^{ +#> })
    growthFunShow("Schnute",3,plot=TRUE) +
    #> expression(E(L[t]) == bgroup("[", L[1]^{ #> b #> } + (L[3]^{ #> b @@ -217,18 +223,23 @@

    Examp #> b #> }) * ~frac(~t ~ -~t[1], ~t[3] ~ -~t[1]), "]")^{ #> ~frac(1, b) -#> })

    growthFunShow("Schnute",4,plot=TRUE)
    #> expression(E(L[t]) == L[1] * e^{ +#> })
    growthFunShow("Schnute",4,plot=TRUE) +
    #> expression(E(L[t]) == L[1] * e^{ #> log ~ bgroup("(", frac(L[3], L[1]), ")") * ~frac(~t ~ -~t[1], #> ~t[3] ~ -~t[1]) #> })
    ## Simple examples -ages <- 1:15 -s1 <- Schnute(ages,case=1,t1=1,t3=15,L1=30,L3=400,a=0.3,b=1) -s2 <- Schnute(ages,case=2,t1=1,t3=15,L1=30,L3=400,a=0.3,b=1) -s3 <- Schnute(ages,case=3,t1=1,t3=15,L1=30,L3=400,a=0.3,b=1) -s4 <- Schnute(ages,case=4,t1=1,t3=15,L1=30,L3=400,a=0.3,b=1) - -plot(s1~ages,type="l",lwd=2)
    lines(s2~ages,lwd=2,col="red")
    lines(s3~ages,lwd=2,col="blue")
    lines(s4~ages,lwd=2,col="green")
    +ages <- 1:15 +s1 <- Schnute(ages,case=1,t1=1,t3=15,L1=30,L3=400,a=0.3,b=1) +s2 <- Schnute(ages,case=2,t1=1,t3=15,L1=30,L3=400,a=0.3,b=1) +s3 <- Schnute(ages,case=3,t1=1,t3=15,L1=30,L3=400,a=0.3,b=1) +s4 <- Schnute(ages,case=4,t1=1,t3=15,L1=30,L3=400,a=0.3,b=1) + +plot(s1~ages,type="l",lwd=2) +
    lines(s2~ages,lwd=2,col="red") +
    lines(s3~ages,lwd=2,col="blue") +
    lines(s4~ages,lwd=2,col="green") +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/SpotVA1-1.png b/docs/reference/SpotVA1-1.png index b00ce632..b60238cc 100644 Binary files a/docs/reference/SpotVA1-1.png and b/docs/reference/SpotVA1-1.png differ diff --git a/docs/reference/SpotVA1.html b/docs/reference/SpotVA1.html index cc176242..8591a625 100644 --- a/docs/reference/SpotVA1.html +++ b/docs/reference/SpotVA1.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -132,7 +132,7 @@

    Age and length of spot.

    Format

    -

    A data frame of 403 observations on the following 2 variables:

    +

    A data frame of 403 observations on the following 2 variables:

    tl

    Measured total lengths (in inches)

    age

    Ages assigned from examination of otoliths

    @@ -158,15 +158,18 @@

    See a

    Used in vbFuns, vbStarts, and nlsTracePlot examples. Also see SpotVA2 in FSAdata for related data.

    Examples

    -
    str(SpotVA1)
    #> 'data.frame': 403 obs. of 2 variables: +
    str(SpotVA1) +
    #> 'data.frame': 403 obs. of 2 variables: #> $ tl : num 6.5 6.3 7.4 7.1 7.7 7.1 7.9 7.3 7.5 7.3 ... -#> $ age: int 0 0 0 0 0 0 0 0 0 0 ...
    head(SpotVA1)
    #> tl age +#> $ age: int 0 0 0 0 0 0 0 0 0 0 ...
    head(SpotVA1) +
    #> tl age #> 1 6.5 0 #> 2 6.3 0 #> 3 7.4 0 #> 4 7.1 0 #> 5 7.7 0 -#> 6 7.1 0
    plot(tl~age,data=SpotVA1)
    +#> 6 7.1 0
    plot(tl~age,data=SpotVA1) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Subset.html b/docs/reference/Subset.html index e59272d8..97fab645 100644 --- a/docs/reference/Subset.html +++ b/docs/reference/Subset.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,9 +128,9 @@

    Subsets/filters a data frame and drops the unused levels.

    Subsets/filters a data frame and drops the unused levels.

    -
    Subset(x, subset, select, drop = FALSE, resetRownames = TRUE, ...)
    +    
    Subset(x, subset, select, drop = FALSE, resetRownames = TRUE, ...)
     
    -filterD(x, ..., except = NULL)
    +filterD(x, ..., except = NULL)

    Arguments

    @@ -149,7 +149,7 @@

    Arg

    - + @@ -179,21 +179,31 @@

    <

    See also

    See subset and filter from dplyr for similar functionality. See drop.levels in gdata and droplevels for related functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## The problem -- note use of unused level in the final table. -levels(iris$Species)
    #> [1] "setosa" "versicolor" "virginica"
    iris.set1 <- subset(iris,Species=="setosa" | Species=="versicolor") -levels(iris.set1$Species)
    #> [1] "setosa" "versicolor" "virginica"
    xtabs(~Species,data=iris)
    #> Species +levels(iris$Species) +
    #> [1] "setosa" "versicolor" "virginica"
    iris.set1 <- subset(iris,Species=="setosa" | Species=="versicolor") +levels(iris.set1$Species) +
    #> [1] "setosa" "versicolor" "virginica"
    xtabs(~Species,data=iris) +
    #> Species #> setosa versicolor virginica #> 50 50 50
    ## A simpler fix using Subset -iris.set2 <- Subset(iris,Species=="setosa" | Species=="versicolor") -levels(iris.set2$Species)
    #> [1] "setosa" "versicolor"
    xtabs(~Species,data=iris.set2)
    #> Species +iris.set2 <- Subset(iris,Species=="setosa" | Species=="versicolor") +levels(iris.set2$Species) +
    #> [1] "setosa" "versicolor"
    xtabs(~Species,data=iris.set2) +
    #> Species #> setosa versicolor #> 50 50
    ## A simpler fix using filterD -iris.set3 <- filterD(iris,Species=="setosa" | Species=="versicolor") -levels(iris.set3$Species)
    #> [1] "setosa" "versicolor"
    xtabs(~Species,data=iris.set3)
    #> Species +iris.set3 <- filterD(iris,Species=="setosa" | Species=="versicolor") +levels(iris.set3$Species) +
    #> [1] "setosa" "versicolor"
    xtabs(~Species,data=iris.set3) +
    #> Species #> setosa versicolor #> 50 50
    @@ -212,7 +222,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Summarize.html b/docs/reference/Summarize.html index eb51c1ea..2e951f9a 100644 --- a/docs/reference/Summarize.html +++ b/docs/reference/Summarize.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,30 +128,30 @@

    Summary statistics for a numeric variable.

    Summary statistics for a single numeric variable, possibly separated by the levels of a factor variable or variables. This function is very similar to summary for a numeric variable.

    -
    Summarize(object, ...)
    +    
    Summarize(object, ...)
     
     # S3 method for default
    -Summarize(
    -  object,
    -  digits = getOption("digits"),
    -  na.rm = TRUE,
    -  exclude = NULL,
    -  nvalid = c("different", "always", "never"),
    -  percZero = c("different", "always", "never"),
    -  ...
    -)
    +Summarize(
    +  object,
    +  digits = getOption("digits"),
    +  na.rm = TRUE,
    +  exclude = NULL,
    +  nvalid = c("different", "always", "never"),
    +  percZero = c("different", "always", "never"),
    +  ...
    +)
     
     # S3 method for formula
    -Summarize(
    -  object,
    -  data = NULL,
    -  digits = getOption("digits"),
    -  na.rm = TRUE,
    -  exclude = NULL,
    -  nvalid = c("different", "always", "never"),
    -  percZero = c("different", "always", "never"),
    -  ...
    -)
    +Summarize( + object, + data = NULL, + digits = getOption("digits"), + na.rm = TRUE, + exclude = NULL, + nvalid = c("different", "always", "never"), + percZero = c("different", "always", "never"), + ... +)

    Arguments

    drop

    passed on to [ indexing operator.

    passed on to [ indexing operator.

    resetRownames
    @@ -210,56 +210,70 @@

    Note

    See also

    See summary for related one dimensional functionality. See tapply, summaryBy in doBy, describe in psych, describe in prettyR, and basicStats in fBasics for similar “by” functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Create a data.frame of "data" -n <- 102 -d <- data.frame(y=c(0,0,NA,NA,NA,runif(n-5)), - w=sample(7:9,n,replace=TRUE), - v=sample(0:2,n,replace=TRUE), - g1=factor(sample(c("A","B","C",NA),n,replace=TRUE)), - g2=factor(sample(c("male","female","UNKNOWN"),n,replace=TRUE)), - g3=sample(c("a","b","c","d"),n,replace=TRUE), - stringsAsFactors=FALSE) +n <- 102 +d <- data.frame(y=c(0,0,NA,NA,NA,runif(n-5)), + w=sample(7:9,n,replace=TRUE), + v=sample(0:2,n,replace=TRUE), + g1=factor(sample(c("A","B","C",NA),n,replace=TRUE)), + g2=factor(sample(c("male","female","UNKNOWN"),n,replace=TRUE)), + g3=sample(c("a","b","c","d"),n,replace=TRUE), + stringsAsFactors=FALSE) # typical output of summary() for a numeric variable -summary(d$y)
    #> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's +summary(d$y) +
    #> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's #> 0.0000 0.2477 0.4228 0.4500 0.6762 0.9953 3
    # this function -Summarize(d$y,digits=3)
    #> n nvalid mean sd min Q1 median Q3 +Summarize(d$y,digits=3) +
    #> n nvalid mean sd min Q1 median Q3 #> 102.000 99.000 0.450 0.282 0.000 0.248 0.423 0.676 #> max percZero -#> 0.995 2.020
    Summarize(~y,data=d,digits=3)
    #> n nvalid mean sd min Q1 median Q3 +#> 0.995 2.020
    Summarize(~y,data=d,digits=3) +
    #> n nvalid mean sd min Q1 median Q3 #> 102.000 99.000 0.450 0.282 0.000 0.248 0.423 0.676 #> max percZero -#> 0.995 2.020
    Summarize(y~1,data=d,digits=3)
    #> n nvalid mean sd min Q1 median Q3 +#> 0.995 2.020
    Summarize(y~1,data=d,digits=3) +
    #> n nvalid mean sd min Q1 median Q3 #> 102.000 99.000 0.450 0.282 0.000 0.248 0.423 0.676 #> max percZero #> 0.995 2.020
    # note that nvalid is not shown if there are no NAs and # percZero is not shown if there are no zeros -Summarize(~w,data=d,digits=3)
    #> n mean sd min Q1 median Q3 max -#> 102.000 8.000 0.833 7.000 7.000 8.000 9.000 9.000
    Summarize(~v,data=d,digits=3)
    #> n mean sd min Q1 median Q3 max +Summarize(~w,data=d,digits=3) +
    #> n mean sd min Q1 median Q3 max +#> 102.000 8.000 0.833 7.000 7.000 8.000 9.000 9.000
    Summarize(~v,data=d,digits=3) +
    #> n mean sd min Q1 median Q3 max #> 102.000 1.069 0.836 0.000 0.000 1.000 2.000 2.000 #> percZero #> 31.373
    # note that the nvalid and percZero results can be forced to be shown -Summarize(~w,data=d,digits=3,nvalid="always",percZero="always")
    #> n nvalid mean sd min Q1 median Q3 +Summarize(~w,data=d,digits=3,nvalid="always",percZero="always") +
    #> n nvalid mean sd min Q1 median Q3 #> 102.000 102.000 8.000 0.833 7.000 7.000 8.000 9.000 #> max percZero #> 9.000 0.000
    ## Numeric vector by levels of a factor variable -Summarize(y~g1,data=d,digits=3)
    #> g1 n nvalid mean sd min Q1 median Q3 max percZero +Summarize(y~g1,data=d,digits=3) +
    #> g1 n nvalid mean sd min Q1 median Q3 max percZero #> 1 A 18 17 0.455 0.245 0.062 0.332 0.448 0.537 0.995 0.000 #> 2 B 29 28 0.509 0.312 0.000 0.235 0.585 0.743 0.971 3.571 -#> 3 C 27 27 0.441 0.283 0.000 0.265 0.413 0.583 0.975 3.704
    Summarize(y~g2,data=d,digits=3)
    #> g2 n nvalid mean sd min Q1 median Q3 max percZero +#> 3 C 27 27 0.441 0.283 0.000 0.265 0.413 0.583 0.975 3.704
    Summarize(y~g2,data=d,digits=3) +
    #> g2 n nvalid mean sd min Q1 median Q3 max percZero #> 1 female 30 30 0.432 0.219 0.000 0.282 0.436 0.517 0.971 3.333 #> 2 male 35 35 0.430 0.313 0.000 0.161 0.362 0.709 0.975 2.857 -#> 3 UNKNOWN 37 34 0.486 0.301 0.028 0.259 0.501 0.701 0.995 0.000
    Summarize(y~g2,data=d,digits=3,exclude="UNKNOWN")
    #> g2 n mean sd min Q1 median Q3 max percZero +#> 3 UNKNOWN 37 34 0.486 0.301 0.028 0.259 0.501 0.701 0.995 0.000
    Summarize(y~g2,data=d,digits=3,exclude="UNKNOWN") +
    #> g2 n mean sd min Q1 median Q3 max percZero #> 1 female 30 0.432 0.219 0 0.282 0.436 0.517 0.971 3.333 #> 2 male 35 0.430 0.313 0 0.161 0.362 0.709 0.975 2.857
    ## Numeric vector by levels of two factor variables -Summarize(y~g1+g2,data=d,digits=3)
    #> g1 g2 n nvalid mean sd min Q1 median Q3 max percZero +Summarize(y~g1+g2,data=d,digits=3) +
    #> g1 g2 n nvalid mean sd min Q1 median Q3 max percZero #> 1 A female 8 8 0.452 0.152 0.180 0.394 0.475 0.512 0.695 0.0 #> 2 B female 8 8 0.644 0.207 0.370 0.490 0.647 0.786 0.971 0.0 #> 3 C female 8 8 0.329 0.173 0.000 0.247 0.345 0.468 0.519 12.5 @@ -268,7 +282,8 @@

    Examp #> 6 C male 10 10 0.511 0.331 0.008 0.284 0.465 0.774 0.975 0.0 #> 7 A UNKNOWN 7 6 0.560 0.335 0.113 0.327 0.582 0.781 0.995 0.0 #> 8 B UNKNOWN 13 12 0.488 0.303 0.120 0.232 0.475 0.712 0.971 0.0 -#> 9 C UNKNOWN 9 9 0.463 0.303 0.028 0.278 0.462 0.618 0.922 0.0

    Summarize(y~g1+g2,data=d,digits=3,exclude="UNKNOWN")
    #> g1 g2 n mean sd min Q1 median Q3 max percZero +#> 9 C UNKNOWN 9 9 0.463 0.303 0.028 0.278 0.462 0.618 0.922 0.0
    Summarize(y~g1+g2,data=d,digits=3,exclude="UNKNOWN") +
    #> g1 g2 n mean sd min Q1 median Q3 max percZero #> 1 A female 8 0.452 0.152 0.180 0.394 0.475 0.512 0.695 0.0 #> 2 B female 8 0.644 0.207 0.370 0.490 0.647 0.786 0.971 0.0 #> 3 C female 8 0.329 0.173 0.000 0.247 0.345 0.468 0.519 12.5 @@ -276,12 +291,14 @@

    Examp #> 5 B male 8 0.406 0.394 0.000 0.028 0.366 0.754 0.892 12.5 #> 6 C male 10 0.511 0.331 0.008 0.284 0.465 0.774 0.975 0.0

    ## What happens if RHS of formula is not a factor -Summarize(y~w,data=d,digits=3)
    #> w n nvalid mean sd min Q1 median Q3 max percZero +Summarize(y~w,data=d,digits=3) +
    #> w n nvalid mean sd min Q1 median Q3 max percZero #> 1 7 35 35 0.450 0.280 0.029 0.254 0.413 0.624 0.971 0.000 #> 2 8 32 29 0.395 0.256 0.000 0.243 0.362 0.548 0.907 3.448 #> 3 9 35 35 0.495 0.303 0.000 0.277 0.463 0.769 0.995 2.857
    ## Summarizing multiple variables in a data.frame (must reduce to numerics) -lapply(as.list(d[,1:3]),Summarize,digits=4)
    #> $y +lapply(as.list(d[,1:3]),Summarize,digits=4) +
    #> $y #> n nvalid mean sd min Q1 median Q3 #> 102.0000 99.0000 0.4500 0.2817 0.0000 0.2477 0.4228 0.6762 #> max percZero @@ -313,7 +330,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/WR79.html b/docs/reference/WR79.html index 7b8caebb..33ed90ff 100644 --- a/docs/reference/WR79.html +++ b/docs/reference/WR79.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -132,7 +132,7 @@

    Ages and lengths for a hypothetical sample from Westerheim and Ricker (1979)

    Format

    -

    A data frame of 2369 observations on the following 3 variables:

    +

    A data frame of 2369 observations on the following 3 variables:

    ID

    Unique fish identifiers

    len

    Length of an individual fish

    age

    Age of an individual fish

    @@ -155,10 +155,12 @@

    Topic

    Examples

    -
    str(WR79)
    #> 'data.frame': 2369 obs. of 3 variables: +
    str(WR79) +
    #> 'data.frame': 2369 obs. of 3 variables: #> $ ID : int 1 2 3 4 5 6 7 8 9 10 ... #> $ len: int 37 37 39 37 37 35 42 42 42 44 ... -#> $ age: int NA NA NA NA 4 4 NA NA NA NA ...
    head(WR79)
    #> ID len age +#> $ age: int NA NA NA NA 4 4 NA NA NA NA ...
    head(WR79) +
    #> ID len age #> 1 1 37 NA #> 2 2 37 NA #> 3 3 39 NA @@ -166,14 +168,16 @@

    Examp #> 5 5 37 4 #> 6 6 35 4

    ## Extract the aged sample -WR79.aged <- subset(WR79,!is.na(age)) -str(WR79.aged)
    #> 'data.frame': 203 obs. of 3 variables: +WR79.aged <- subset(WR79,!is.na(age)) +str(WR79.aged) +
    #> 'data.frame': 203 obs. of 3 variables: #> $ ID : int 5 6 21 32 40 57 59 70 94 117 ... #> $ len: int 37 35 42 43 40 41 44 46 45 47 ... #> $ age: int 4 4 4 4 4 4 4 4 4 4 ...
    ## Extract the length sample -WR79.length <- subset(WR79,is.na(age)) -str(WR79.length)
    #> 'data.frame': 2166 obs. of 3 variables: +WR79.length <- subset(WR79,is.na(age)) +str(WR79.length) +
    #> 'data.frame': 2166 obs. of 3 variables: #> $ ID : int 1 2 3 4 7 8 9 10 11 12 ... #> $ len: int 37 37 39 37 42 42 42 44 44 43 ... #> $ age: int NA NA NA NA NA NA NA NA NA NA ...
    @@ -193,7 +197,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/WSlit.html b/docs/reference/WSlit.html index 2ce96afd..b7641238 100644 --- a/docs/reference/WSlit.html +++ b/docs/reference/WSlit.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -132,7 +132,7 @@

    All known standard weight equations.

    Format

    -

    A data frame with observations on the following 13 variables:

    +

    A data frame with observations on the following 13 variables:

    species

    Species name.

    units

    Units of measurements. Metric uses lengths in mm and weight in grams. English uses lengths in inches and weight in pounds.

    type

    Type of equation (linear or quadratic).

    @@ -171,13 +171,14 @@

    <

    8-Condition.

    References

    -

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

    +

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

    See also

    See wsVal and wrAdd for related functionality.

    Examples

    -
    str(WSlit)
    #> 'data.frame': 179 obs. of 13 variables: +
    str(WSlit) +
    #> 'data.frame': 179 obs. of 13 variables: #> $ species: Factor w/ 93 levels "Aegean Chub",..: 1 2 2 3 3 3 4 4 4 5 ... #> $ units : Factor w/ 2 levels "English","metric": 2 1 2 2 2 2 2 2 2 1 ... #> $ type : Factor w/ 2 levels "linear","quadratic": 2 1 1 2 2 2 2 2 2 1 ... @@ -190,7 +191,8 @@

    Examp #> $ slope : num 1.78 3.12 3.12 3.63 3.15 ... #> $ quad : num 0.329 NA NA -0.111 -0.011 0.188 -0.128 -0.043 0.075 NA ... #> $ source : Factor w/ 49 levels "Anderson and Gutreuter (1983)",..: 18 5 5 11 11 11 11 11 11 5 ... -#> $ comment: Factor w/ 13 levels "body length",..: 7 6 6 7 11 7 7 11 11 6 ...

    head(WSlit)
    #> species units type ref measure method min.len max.len +#> $ comment: Factor w/ 13 levels "body length",..: 7 6 6 7 11 7 7 11 11 6 ...
    head(WSlit) +
    #> species units type ref measure method min.len max.len #> 1 Aegean Chub metric quadratic 75 TL EmP 70 220 #> 2 Bigmouth Buffalo English linear 75 TL RLP 6 NA #> 3 Bigmouth Buffalo metric linear 75 TL RLP 150 NA @@ -227,7 +229,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/WhitefishLC.html b/docs/reference/WhitefishLC.html index 0f3c3bfb..bc8669c2 100644 --- a/docs/reference/WhitefishLC.html +++ b/docs/reference/WhitefishLC.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -132,7 +132,7 @@

    Assigned ages from two readers on three structures for Lake Whitefish from L

    Format

    -

    A data frame with 151 observations on the following 11 variables:

    +

    A data frame with 151 observations on the following 11 variables:

    fishID

    A unique fish identification number

    tl

    Total length (in mm)

    scale1

    Assessed age from scales by first reader

    @@ -167,7 +167,8 @@

    See a

    Used in ageBias and agePrecision examples.

    Examples

    -
    str(WhitefishLC)
    #> 'data.frame': 151 obs. of 11 variables: +
    str(WhitefishLC) +
    #> 'data.frame': 151 obs. of 11 variables: #> $ fishID : int 1 2 3 4 5 6 7 8 9 10 ... #> $ tl : int 345 334 348 300 330 316 508 475 340 173 ... #> $ scale1 : int 3 4 7 4 3 4 6 4 3 1 ... @@ -178,7 +179,8 @@

    Examp #> $ finrayC : int 3 3 3 3 4 3 6 9 3 1 ... #> $ otolith1: int 3 3 3 3 3 6 9 11 3 1 ... #> $ otolith2: int 3 3 3 3 3 5 10 12 4 1 ... -#> $ otolithC: int 3 3 3 3 3 6 10 11 4 1 ...

    head(WhitefishLC)
    #> fishID tl scale1 scale2 scaleC finray1 finray2 finrayC otolith1 otolith2 +#> $ otolithC: int 3 3 3 3 3 6 10 11 4 1 ...
    head(WhitefishLC) +
    #> fishID tl scale1 scale2 scaleC finray1 finray2 finrayC otolith1 otolith2 #> 1 1 345 3 3 3 3 3 3 3 3 #> 2 2 334 4 3 4 3 3 3 3 3 #> 3 3 348 7 5 6 3 3 3 3 3 @@ -208,7 +210,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/addZeroCatch.html b/docs/reference/addZeroCatch.html index 2bde1f8f..89535cbf 100644 --- a/docs/reference/addZeroCatch.html +++ b/docs/reference/addZeroCatch.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31
    @@ -128,7 +128,7 @@

    Adds zeros for catches of species not collected in some sampling events.

    Adds zeros for catches of species that were not captured in a sampling event but were captured in at least one other sampling event (i.e., adds zeros to the data.frame for capture events where a species was not observed).

    -
    addZeroCatch(df, eventvar, specvar, zerovar, na.rm = TRUE)
    +
    addZeroCatch(df, eventvar, specvar, zerovar, na.rm = TRUE)

    Arguments

    @@ -172,31 +172,37 @@

    <

    2-Basic Data Manipulations

    References

    -

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

    +

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

    See also

    complete in tidyr package.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Example Data #1 (some nets missing some fish, ancillary net data) -df1 <- data.frame(net=c(1,1,1,2,2,3), - eff=c(1,1,1,1,1,1), - species=c("BKT","LKT","RBT","BKT","LKT","RBT"), - catch=c(3,4,5,5,4,3)) -df1
    #> net eff species catch +df1 <- data.frame(net=c(1,1,1,2,2,3), + eff=c(1,1,1,1,1,1), + species=c("BKT","LKT","RBT","BKT","LKT","RBT"), + catch=c(3,4,5,5,4,3)) +df1 +
    #> net eff species catch #> 1 1 1 BKT 3 #> 2 1 1 LKT 4 #> 3 1 1 RBT 5 #> 4 2 1 BKT 5 #> 5 2 1 LKT 4 #> 6 3 1 RBT 3
    # not all 1s -xtabs(~net+species,data=df1)
    #> species +xtabs(~net+species,data=df1) +
    #> species #> net BKT LKT RBT #> 1 1 1 1 #> 2 1 1 0 #> 3 0 0 1
    -df1mod1 <- addZeroCatch(df1,"net","species",zerovar="catch") -df1mod1
    #> net eff species catch +df1mod1 <- addZeroCatch(df1,"net","species",zerovar="catch") +df1mod1 +
    #> net eff species catch #> 1 1 1 BKT 3 #> 2 1 1 LKT 4 #> 3 1 1 RBT 5 @@ -206,32 +212,38 @@

    Examp #> 7 3 1 BKT 0 #> 8 3 1 LKT 0 #> 9 2 1 RBT 0

    # check, should all be 3 -xtabs(~net,data=df1mod1)
    #> net +xtabs(~net,data=df1mod1) +
    #> net #> 1 2 3 #> 3 3 3
    # check, should all be 1 -xtabs(~net+species,data=df1mod1)
    #> species +xtabs(~net+species,data=df1mod1) +
    #> species #> net BKT LKT RBT #> 1 1 1 1 #> 2 1 1 1 #> 3 1 1 1
    # correct mean/sd of catches -Summarize(catch~species,data=df1mod1)
    #> species n mean sd min Q1 median Q3 max percZero +Summarize(catch~species,data=df1mod1) +
    #> species n mean sd min Q1 median Q3 max percZero #> 1 BKT 3 2.666667 2.516611 0 1.5 3 4 5 33.33333 #> 2 LKT 3 2.666667 2.309401 0 2.0 4 4 4 33.33333 #> 3 RBT 3 2.666667 2.516611 0 1.5 3 4 5 33.33333
    # incorrect mean/sd of catches (no zeros) -Summarize(catch~species,data=df1)
    #> species n mean sd min Q1 median Q3 max +Summarize(catch~species,data=df1) +
    #> species n mean sd min Q1 median Q3 max #> 1 BKT 2 4 1.414214 3 3.5 4 4.5 5 #> 2 LKT 2 4 0.000000 4 4.0 4 4.0 4 #> 3 RBT 2 4 1.414214 3 3.5 4 4.5 5
    # Same as example 1 but with no ancillary data specific to the net number -df2 <- df1[,-2] -df2
    #> net species catch +df2 <- df1[,-2] +df2 +
    #> net species catch #> 1 1 BKT 3 #> 2 1 LKT 4 #> 3 1 RBT 5 #> 4 2 BKT 5 #> 5 2 LKT 4 -#> 6 3 RBT 3
    df1mod2 <- addZeroCatch(df2,"net","species",zerovar="catch") -df1mod2
    #> net species catch +#> 6 3 RBT 3
    df1mod2 <- addZeroCatch(df2,"net","species",zerovar="catch") +df1mod2 +
    #> net species catch #> 1 1 BKT 3 #> 2 1 LKT 4 #> 3 1 RBT 5 @@ -241,18 +253,20 @@

    Examp #> 7 3 BKT 0 #> 8 3 LKT 0 #> 9 2 RBT 0

    # check, should all be 1 -xtabs(~net+species,data=df1mod2)
    #> species +xtabs(~net+species,data=df1mod2) +
    #> species #> net BKT LKT RBT #> 1 1 1 1 #> 2 1 1 1 #> 3 1 1 1
    ## Example Data #3 (All nets have same species ... no zeros needed) -df3 <- data.frame(net=c(1,1,1,2,2,2,3,3,3), - eff=c(1,1,1,1,1,1,1,1,1), - species=c("BKT","LKT","RBT","BKT","LKT", - "RBT","BKT","LKT","RBT"), - catch=c(3,4,5,5,4,3,3,2,7)) -df3
    #> net eff species catch +df3 <- data.frame(net=c(1,1,1,2,2,2,3,3,3), + eff=c(1,1,1,1,1,1,1,1,1), + species=c("BKT","LKT","RBT","BKT","LKT", + "RBT","BKT","LKT","RBT"), + catch=c(3,4,5,5,4,3,3,2,7)) +df3 +
    #> net eff species catch #> 1 1 1 BKT 3 #> 2 1 1 LKT 4 #> 3 1 1 RBT 5 @@ -262,36 +276,42 @@

    Examp #> 7 3 1 BKT 3 #> 8 3 1 LKT 2 #> 9 3 1 RBT 7

    # should all be 1 for this example -xtabs(~net+species,data=df3)
    #> species +xtabs(~net+species,data=df3) +
    #> species #> net BKT LKT RBT #> 1 1 1 1 #> 2 1 1 1 #> 3 1 1 1
    # should receive a warning and table should still all be 1 -df3mod1 <- addZeroCatch(df3,"net","species",zerovar="catch")
    #> Warning: All 'eventvar' have all species in 'specvar'; thus, there are no -#> zeros to add. The original data.frame was returned.
    xtabs(~net+species,data=df3mod1)
    #> species +df3mod1 <- addZeroCatch(df3,"net","species",zerovar="catch") +
    #> Warning: All 'eventvar' have all species in 'specvar'; thus, there are no +#> zeros to add. The original data.frame was returned.
    xtabs(~net+species,data=df3mod1) +
    #> species #> net BKT LKT RBT #> 1 1 1 1 #> 2 1 1 1 #> 3 1 1 1
    ## Example Data #4 (another variable that needs zeros) -df4 <- df1 -df4$recaps <- c(0,0,0,1,2,1) -df4
    #> net eff species catch recaps +df4 <- df1 +df4$recaps <- c(0,0,0,1,2,1) +df4 +
    #> net eff species catch recaps #> 1 1 1 BKT 3 0 #> 2 1 1 LKT 4 0 #> 3 1 1 RBT 5 0 #> 4 2 1 BKT 5 1 #> 5 2 1 LKT 4 2 #> 6 3 1 RBT 3 1
    # not all 1s -xtabs(~net+species,data=df4)
    #> species +xtabs(~net+species,data=df4) +
    #> species #> net BKT LKT RBT #> 1 1 1 1 #> 2 1 1 0 #> 3 0 0 1
    -df4mod1 <- addZeroCatch(df4,"net","species",zerovar=c("catch","recaps")) +df4mod1 <- addZeroCatch(df4,"net","species",zerovar=c("catch","recaps")) # note zeros in both variables -df4mod1
    #> net eff species catch recaps +df4mod1 +
    #> net eff species catch recaps #> 1 1 1 BKT 3 0 #> 2 1 1 LKT 4 0 #> 3 1 1 RBT 5 0 @@ -301,36 +321,43 @@

    Examp #> 7 3 1 BKT 0 0 #> 8 3 1 LKT 0 0 #> 9 2 1 RBT 0 0

    # check, should all be 1 -xtabs(~net+species,data=df4mod1)
    #> species +xtabs(~net+species,data=df4mod1) +
    #> species #> net BKT LKT RBT #> 1 1 1 1 #> 2 1 1 1 #> 3 1 1 1
    # observe difference from next -Summarize(catch~species,data=df4)
    #> species n mean sd min Q1 median Q3 max +Summarize(catch~species,data=df4) +
    #> species n mean sd min Q1 median Q3 max #> 1 BKT 2 4 1.414214 3 3.5 4 4.5 5 #> 2 LKT 2 4 0.000000 4 4.0 4 4.0 4 -#> 3 RBT 2 4 1.414214 3 3.5 4 4.5 5
    Summarize(catch~species,data=df4mod1)
    #> species n mean sd min Q1 median Q3 max percZero +#> 3 RBT 2 4 1.414214 3 3.5 4 4.5 5
    Summarize(catch~species,data=df4mod1) +
    #> species n mean sd min Q1 median Q3 max percZero #> 1 BKT 3 2.666667 2.516611 0 1.5 3 4 5 33.33333 #> 2 LKT 3 2.666667 2.309401 0 2.0 4 4 4 33.33333 #> 3 RBT 3 2.666667 2.516611 0 1.5 3 4 5 33.33333
    # observe difference from next -Summarize(recaps~species,data=df4)
    #> species n mean sd min Q1 median Q3 max percZero +Summarize(recaps~species,data=df4) +
    #> species n mean sd min Q1 median Q3 max percZero #> 1 BKT 2 0.5 0.7071068 0 0.25 0.5 0.75 1 50 #> 2 LKT 2 1.0 1.4142136 0 0.50 1.0 1.50 2 50 -#> 3 RBT 2 0.5 0.7071068 0 0.25 0.5 0.75 1 50
    Summarize(recaps~species,data=df4mod1)
    #> species n mean sd min Q1 median Q3 max percZero +#> 3 RBT 2 0.5 0.7071068 0 0.25 0.5 0.75 1 50
    Summarize(recaps~species,data=df4mod1) +
    #> species n mean sd min Q1 median Q3 max percZero #> 1 BKT 3 0.3333333 0.5773503 0 0 0 0.5 1 66.66667 #> 2 LKT 3 0.6666667 1.1547005 0 0 0 1.0 2 66.66667 #> 3 RBT 3 0.3333333 0.5773503 0 0 0 0.5 1 66.66667
    ## Example Data #5 (two "specvar"s) -df5 <- df1 -df5$sex <- c("m","m","f","m","f","f") -df5
    #> net eff species catch sex +df5 <- df1 +df5$sex <- c("m","m","f","m","f","f") +df5 +
    #> net eff species catch sex #> 1 1 1 BKT 3 m #> 2 1 1 LKT 4 m #> 3 1 1 RBT 5 f #> 4 2 1 BKT 5 m #> 5 2 1 LKT 4 f #> 6 3 1 RBT 3 f
    # not all 1s -xtabs(~sex+species+net,data=df5)
    #> , , net = 1 +xtabs(~sex+species+net,data=df5) +
    #> , , net = 1 #> #> species #> sex BKT LKT RBT @@ -351,8 +378,9 @@

    Examp #> f 0 0 1 #> m 0 0 0 #>

    -df5mod1 <- addZeroCatch(df5,"net",c("species","sex"),zerovar="catch") -df5mod1
    #> net eff species catch sex +df5mod1 <- addZeroCatch(df5,"net",c("species","sex"),zerovar="catch") +df5mod1 +
    #> net eff species catch sex #> 1 1 1 BKT 3 m #> 2 1 1 LKT 4 m #> 3 1 1 RBT 5 f @@ -371,7 +399,8 @@

    Examp #> 16 1 1 RBT 0 m #> 17 2 1 RBT 0 m #> 18 3 1 RBT 0 m

    # all 1s -xtabs(~sex+species+net,data=df5mod1)
    #> , , net = 1 +xtabs(~sex+species+net,data=df5mod1) +
    #> , , net = 1 #> #> species #> sex BKT LKT RBT @@ -391,24 +420,27 @@

    Examp #> sex BKT LKT RBT #> f 1 1 1 #> m 1 1 1 -#>

    str(df5mod1)
    #> 'data.frame': 18 obs. of 5 variables: +#>
    str(df5mod1) +
    #> 'data.frame': 18 obs. of 5 variables: #> $ net : num 1 1 1 2 2 3 1 2 3 1 ... #> $ eff : num 1 1 1 1 1 1 1 1 1 1 ... #> $ species: chr "BKT" "LKT" "RBT" "BKT" ... #> $ catch : num 3 4 5 5 4 3 0 0 0 0 ... #> $ sex : chr "m" "m" "f" "m" ...
    ## Example Data #6 (three "specvar"s) -df6 <- df5 -df6$size <- c("lrg","lrg","lrg","sm","lrg","sm") -df6
    #> net eff species catch sex size +df6 <- df5 +df6$size <- c("lrg","lrg","lrg","sm","lrg","sm") +df6 +
    #> net eff species catch sex size #> 1 1 1 BKT 3 m lrg #> 2 1 1 LKT 4 m lrg #> 3 1 1 RBT 5 f lrg #> 4 2 1 BKT 5 m sm #> 5 2 1 LKT 4 f lrg #> 6 3 1 RBT 3 f sm
    -df6mod1 <- addZeroCatch(df6,"net",c("species","sex","size"),zerovar="catch") -df6mod1
    #> net eff species catch sex size +df6mod1 <- addZeroCatch(df6,"net",c("species","sex","size"),zerovar="catch") +df6mod1 +
    #> net eff species catch sex size #> 1 1 1 BKT 3 m lrg #> 2 1 1 LKT 4 m lrg #> 3 1 1 RBT 5 f lrg @@ -461,7 +493,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/ageBias-1.png b/docs/reference/ageBias-1.png index 0caa35fa..992098ba 100644 Binary files a/docs/reference/ageBias-1.png and b/docs/reference/ageBias-1.png differ diff --git a/docs/reference/ageBias-10.png b/docs/reference/ageBias-10.png index 32e47faa..bf6187f7 100644 Binary files a/docs/reference/ageBias-10.png and b/docs/reference/ageBias-10.png differ diff --git a/docs/reference/ageBias-11.png b/docs/reference/ageBias-11.png index dfa66240..5468946b 100644 Binary files a/docs/reference/ageBias-11.png and b/docs/reference/ageBias-11.png differ diff --git a/docs/reference/ageBias-12.png b/docs/reference/ageBias-12.png index cf343bf6..f08d47de 100644 Binary files a/docs/reference/ageBias-12.png and b/docs/reference/ageBias-12.png differ diff --git a/docs/reference/ageBias-13.png b/docs/reference/ageBias-13.png index 27c06492..088040c3 100644 Binary files a/docs/reference/ageBias-13.png and b/docs/reference/ageBias-13.png differ diff --git a/docs/reference/ageBias-14.png b/docs/reference/ageBias-14.png index 9804073c..1172f7a5 100644 Binary files a/docs/reference/ageBias-14.png and b/docs/reference/ageBias-14.png differ diff --git a/docs/reference/ageBias-15.png b/docs/reference/ageBias-15.png index 440ad995..3459226a 100644 Binary files a/docs/reference/ageBias-15.png and b/docs/reference/ageBias-15.png differ diff --git a/docs/reference/ageBias-16.png b/docs/reference/ageBias-16.png index 85a3f068..d8351b7f 100644 Binary files a/docs/reference/ageBias-16.png and b/docs/reference/ageBias-16.png differ diff --git a/docs/reference/ageBias-17.png b/docs/reference/ageBias-17.png index 1732fd80..8bb4e0e5 100644 Binary files a/docs/reference/ageBias-17.png and b/docs/reference/ageBias-17.png differ diff --git a/docs/reference/ageBias-18.png b/docs/reference/ageBias-18.png index 69850eae..45b70070 100644 Binary files a/docs/reference/ageBias-18.png and b/docs/reference/ageBias-18.png differ diff --git a/docs/reference/ageBias-19.png b/docs/reference/ageBias-19.png index 5273e8fa..d5e3e0ae 100644 Binary files a/docs/reference/ageBias-19.png and b/docs/reference/ageBias-19.png differ diff --git a/docs/reference/ageBias-2.png b/docs/reference/ageBias-2.png index b6e7745e..e118227d 100644 Binary files a/docs/reference/ageBias-2.png and b/docs/reference/ageBias-2.png differ diff --git a/docs/reference/ageBias-20.png b/docs/reference/ageBias-20.png index 03f837b3..416b8149 100644 Binary files a/docs/reference/ageBias-20.png and b/docs/reference/ageBias-20.png differ diff --git a/docs/reference/ageBias-21.png b/docs/reference/ageBias-21.png index dee42d7c..1c259cbf 100644 Binary files a/docs/reference/ageBias-21.png and b/docs/reference/ageBias-21.png differ diff --git a/docs/reference/ageBias-22.png b/docs/reference/ageBias-22.png index 0df187fd..2e641b16 100644 Binary files a/docs/reference/ageBias-22.png and b/docs/reference/ageBias-22.png differ diff --git a/docs/reference/ageBias-3.png b/docs/reference/ageBias-3.png index 4754eadc..384dc52c 100644 Binary files a/docs/reference/ageBias-3.png and b/docs/reference/ageBias-3.png differ diff --git a/docs/reference/ageBias-4.png b/docs/reference/ageBias-4.png index 6c20370f..1a078689 100644 Binary files a/docs/reference/ageBias-4.png and b/docs/reference/ageBias-4.png differ diff --git a/docs/reference/ageBias-5.png b/docs/reference/ageBias-5.png index 80d91a35..1b8fa5eb 100644 Binary files a/docs/reference/ageBias-5.png and b/docs/reference/ageBias-5.png differ diff --git a/docs/reference/ageBias-6.png b/docs/reference/ageBias-6.png index 3d1be78e..a60c1ef9 100644 Binary files a/docs/reference/ageBias-6.png and b/docs/reference/ageBias-6.png differ diff --git a/docs/reference/ageBias-7.png b/docs/reference/ageBias-7.png index 6584c049..59d104c7 100644 Binary files a/docs/reference/ageBias-7.png and b/docs/reference/ageBias-7.png differ diff --git a/docs/reference/ageBias-8.png b/docs/reference/ageBias-8.png index a0b6e553..310bc755 100644 Binary files a/docs/reference/ageBias-8.png and b/docs/reference/ageBias-8.png differ diff --git a/docs/reference/ageBias-9.png b/docs/reference/ageBias-9.png index b2d97b92..75009780 100644 Binary files a/docs/reference/ageBias-9.png and b/docs/reference/ageBias-9.png differ diff --git a/docs/reference/ageBias.html b/docs/reference/ageBias.html index ea102327..0b6d146b 100644 --- a/docs/reference/ageBias.html +++ b/docs/reference/ageBias.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,67 +128,67 @@

    Compute and view possible differences between paired sets of ages.

    Constructs age-agreement tables, statistical tests to detect differences, and plots to visualize potential differences in paired age estimates. Ages may be from, for example, two readers of the same structure, one reader at two times, two structures (e.g., scales, spines, otoliths), or one structure and known ages.

    -
    ageBias(
    -  formula,
    -  data,
    -  ref.lab = tmp$Enames,
    -  nref.lab = tmp$Rname,
    -  method = stats::p.adjust.methods,
    -  sig.level = 0.05,
    -  min.n.CI = 3
    -)
    +    
    ageBias(
    +  formula,
    +  data,
    +  ref.lab = tmp$Enames,
    +  nref.lab = tmp$Rname,
    +  method = stats::p.adjust.methods,
    +  sig.level = 0.05,
    +  min.n.CI = 3
    +)
     
     # S3 method for ageBias
    -summary(
    -  object,
    -  what = c("table", "symmetry", "Bowker", "EvansHoenig", "McNemar", "bias",
    -    "diff.bias", "n"),
    -  flip.table = FALSE,
    -  zero.print = "-",
    -  digits = 3,
    -  cont.corr = c("none", "Yates", "Edwards"),
    -  ...
    -)
    +summary(
    +  object,
    +  what = c("table", "symmetry", "Bowker", "EvansHoenig", "McNemar", "bias",
    +    "diff.bias", "n"),
    +  flip.table = FALSE,
    +  zero.print = "-",
    +  digits = 3,
    +  cont.corr = c("none", "Yates", "Edwards"),
    +  ...
    +)
     
     # S3 method for ageBias
    -plot(
    -  x,
    -  xvals = c("reference", "mean"),
    -  xlab = ifelse(xvals == "reference", x$ref.lab, "Mean Age"),
    -  ylab = paste(x$nref.lab, "-", x$ref.lab),
    -  xlim = NULL,
    -  ylim = NULL,
    -  yaxt = graphics::par("yaxt"),
    -  xaxt = graphics::par("xaxt"),
    -  col.agree = "gray60",
    -  lwd.agree = lwd,
    -  lty.agree = 2,
    -  lwd = 1,
    -  sfrac = 0,
    -  show.pts = NULL,
    -  pch.pts = 20,
    -  cex.pts = ifelse(xHist | yHist, 1.5, 1),
    -  col.pts = "black",
    -  transparency = 1/10,
    -  show.CI = FALSE,
    -  col.CI = "black",
    -  col.CIsig = "red",
    -  lwd.CI = lwd,
    -  sfrac.CI = sfrac,
    -  show.range = NULL,
    -  col.range = ifelse(show.CI, "gray70", "black"),
    -  lwd.range = lwd,
    -  sfrac.range = sfrac,
    -  pch.mean = 19,
    -  pch.mean.sig = ifelse(show.CI | show.range, 21, 19),
    -  cex.mean = lwd,
    -  yHist = TRUE,
    -  xHist = NULL,
    -  hist.panel.size = 1/7,
    -  col.hist = "gray90",
    -  allowAdd = FALSE,
    -  ...
    -)
    +plot( + x, + xvals = c("reference", "mean"), + xlab = ifelse(xvals == "reference", x$ref.lab, "Mean Age"), + ylab = paste(x$nref.lab, "-", x$ref.lab), + xlim = NULL, + ylim = NULL, + yaxt = graphics::par("yaxt"), + xaxt = graphics::par("xaxt"), + col.agree = "gray60", + lwd.agree = lwd, + lty.agree = 2, + lwd = 1, + sfrac = 0, + show.pts = NULL, + pch.pts = 20, + cex.pts = ifelse(xHist | yHist, 1.5, 1), + col.pts = "black", + transparency = 1/10, + show.CI = FALSE, + col.CI = "black", + col.CIsig = "red", + lwd.CI = lwd, + sfrac.CI = sfrac, + show.range = NULL, + col.range = ifelse(show.CI, "gray70", "black"), + lwd.range = lwd, + sfrac.range = sfrac, + pch.mean = 19, + pch.mean.sig = ifelse(show.CI | show.range, 21, 19), + cex.mean = lwd, + yHist = TRUE, + xHist = NULL, + hist.panel.size = 1/7, + col.hist = "gray90", + allowAdd = FALSE, + ... +)

    Arguments

    @@ -405,7 +405,7 @@

    <

    4-Age Comparisons. Note that plot has changed since IFAR was published. Some of the original functionality is in plotAB.

    References

    -

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

    +

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

    Campana, S.E., M.C. Annand, and J.I. McMillan. 1995. Graphical and statistical methods for determining the consistency of age determinations. Transactions of the American Fisheries Society 124:131-138. [Was (is?) available from http://www.bio.gc.ca/otoliths/documents/Campana%20et%20al%201995%20TAFS.pdf.]

    Evans, G.T. and J.M. Hoenig. 1998. Testing and viewing symmetry in contingency tables, with application to readers of fish ages. Biometrics 54:620-629.

    Hoenig, J.M., M.J. Morgan, and C.A. Brown. 1995. Analysing differences between two age determination methods by tests of symmetry. Canadian Journal of Fisheries and Aquatic Sciences 52:364-368.

    @@ -414,11 +414,15 @@

    R

    See also

    See agePrecision for measures of precision between pairs of age estimates. See compare2 in fishmethods for similar functionality. See plotAB for a more traditional age-bias plot.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    ab1 <- ageBias(scaleC~otolithC,data=WhitefishLC, - ref.lab="Otolith Age",nref.lab="Scale Age") -summary(ab1)
    #> Sample size in the age agreement table is 151. +
    ab1 <- ageBias(scaleC~otolithC,data=WhitefishLC, + ref.lab="Otolith Age",nref.lab="Scale Age") +summary(ab1) +
    #> Sample size in the age agreement table is 151. #> #> Summary of Scale Age by Otolith Age #> otolithC n min max mean SE t adj.p sig LCI UCI @@ -497,14 +501,20 @@

    Examp #> symTest df chi.sq p #> 1 McNemar 1 51.57851 6.879037e-13 #> 2 EvansHoenig 10 62.46849 1.232555e-09 -#> 3 Bowker 54 75.97662 2.598188e-02

    summary(ab1,what="symmetry")
    #> symTest df chi.sq p +#> 3 Bowker 54 75.97662 2.598188e-02
    summary(ab1,what="symmetry") +
    #> symTest df chi.sq p #> 1 McNemar 1 51.57851 6.879037e-13 #> 2 EvansHoenig 10 62.46849 1.232555e-09 -#> 3 Bowker 54 75.97662 2.598188e-02
    summary(ab1,what="Bowker")
    #> symTest df chi.sq p -#> 1 Bowker 54 75.97662 0.02598188
    summary(ab1,what="EvansHoenig")
    #> symTest df chi.sq p -#> 1 EvansHoenig 10 62.46849 1.232555e-09
    summary(ab1,what="McNemar")
    #> symTest df chi.sq p -#> 1 McNemar 1 51.57851 6.879037e-13
    summary(ab1,what="McNemar",cont.corr="Yates")
    #> symTest df chi.sq p -#> 1 McNemar (Yates Correction) 1 50.92769 9.583228e-13
    summary(ab1,what="bias")
    #> otolithC n min max mean SE t adj.p sig LCI UCI +#> 3 Bowker 54 75.97662 2.598188e-02
    summary(ab1,what="Bowker") +
    #> symTest df chi.sq p +#> 1 Bowker 54 75.97662 0.02598188
    summary(ab1,what="EvansHoenig") +
    #> symTest df chi.sq p +#> 1 EvansHoenig 10 62.46849 1.232555e-09
    summary(ab1,what="McNemar") +
    #> symTest df chi.sq p +#> 1 McNemar 1 51.57851 6.879037e-13
    summary(ab1,what="McNemar",cont.corr="Yates") +
    #> symTest df chi.sq p +#> 1 McNemar (Yates Correction) 1 50.92769 9.583228e-13
    summary(ab1,what="bias") +
    #> otolithC n min max mean SE t adj.p sig LCI UCI #> 1 9 1 2 1.44 0.176 2.530 0.28212 FALSE 1.039 1.85 #> 2 7 1 5 2.00 0.577 0.000 1.00000 FALSE 0.587 3.41 #> 3 17 1 6 3.35 0.242 1.461 0.81743 FALSE 2.841 3.87 @@ -524,7 +534,8 @@

    Examp #> 17 4 9 13 11.00 0.816 -7.348 0.05729 FALSE 8.402 13.60 #> 18 2 7 13 10.00 NA NA NA FALSE NA NA #> 19 1 14 14 14.00 NA NA NA FALSE NA NA -#> 23 1 10 10 10.00 NA NA NA FALSE NA NA

    summary(ab1,what="diff.bias")
    #> otolithC n min max mean SE t adj.p sig LCI UCI +#> 23 1 10 10 10.00 NA NA NA FALSE NA NA
    summary(ab1,what="diff.bias") +
    #> otolithC n min max mean SE t adj.p sig LCI UCI #> 1 9 0 1 0.444 0.176 2.530 0.28212 FALSE 0.0393 0.850 #> 2 7 -1 3 0.000 0.577 0.000 1.00000 FALSE -1.4127 1.413 #> 3 17 -2 3 0.353 0.242 1.461 0.81743 FALSE -0.1593 0.865 @@ -544,7 +555,9 @@

    Examp #> 17 4 -8 -4 -6.000 0.816 -7.348 0.05729 FALSE -8.5985 -3.402 #> 18 2 -11 -5 -8.000 NA NA NA FALSE NA NA #> 19 1 -5 -5 -5.000 NA NA NA FALSE NA NA -#> 23 1 -13 -13 -13.000 NA NA NA FALSE NA NA

    summary(ab1,what="n")
    #> Sample size in the age agreement table is 151.
    summary(ab1,what=c("n","symmetry","table"))
    #> Sample size in the age agreement table is 151. +#> 23 1 -13 -13 -13.000 NA NA NA FALSE NA NA
    summary(ab1,what="n") +
    #> Sample size in the age agreement table is 151.
    summary(ab1,what=c("n","symmetry","table")) +
    #> Sample size in the age agreement table is 151. #> #> Raw agreement table (square) #> Otolith Age @@ -578,7 +591,8 @@

    Examp #> 1 McNemar 1 51.57851 6.879037e-13 #> 2 EvansHoenig 10 62.46849 1.232555e-09 #> 3 Bowker 54 75.97662 2.598188e-02

    # flip table (easy to compare to age bias plot) and show zeroes (not dashes) -summary(ab1,what="table",flip.table=TRUE,zero.print="0")
    #> Otolith Age +summary(ab1,what="table",flip.table=TRUE,zero.print="0") +
    #> Otolith Age #> Scale Age 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #> 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 @@ -607,30 +621,47 @@

    Examp ############################################################# ## Differences Plot (inspired by Muir et al. (2008)) # Default (ranges, open circles for sig diffs, marginal hists) -plot(ab1)

    # Show CIs for means (with and without ranges) -plot(ab1,show.CI=TRUE)
    plot(ab1,show.CI=TRUE,show.range=FALSE)
    # show points (with and without CIs) -plot(ab1,show.CI=TRUE,show.range=FALSE,show.pts=TRUE)
    plot(ab1,show.range=FALSE,show.pts=TRUE)
    # Use same symbols for all means (with ranges) -plot(ab1,pch.mean.sig=19)
    # Use same symbols/colors for all means/CIs (without ranges) -plot(ab1,show.range=FALSE,show.CI=TRUE,pch.mean.sig=19,col.CIsig="black")
    # Remove histograms -plot(ab1,xHist=FALSE)
    plot(ab1,yHist=FALSE)
    plot(ab1,xHist=FALSE,yHist=FALSE)
    ## Suppress confidence intervals for n < a certain value +plot(ab1) +
    # Show CIs for means (with and without ranges) +plot(ab1,show.CI=TRUE) +
    plot(ab1,show.CI=TRUE,show.range=FALSE) +
    # show points (with and without CIs) +plot(ab1,show.CI=TRUE,show.range=FALSE,show.pts=TRUE) +
    plot(ab1,show.range=FALSE,show.pts=TRUE) +
    # Use same symbols for all means (with ranges) +plot(ab1,pch.mean.sig=19) +
    # Use same symbols/colors for all means/CIs (without ranges) +plot(ab1,show.range=FALSE,show.CI=TRUE,pch.mean.sig=19,col.CIsig="black") +
    # Remove histograms +plot(ab1,xHist=FALSE) +
    plot(ab1,yHist=FALSE) +
    plot(ab1,xHist=FALSE,yHist=FALSE) +
    ## Suppress confidence intervals for n < a certain value ## must set this in the original ageBias() call -ab2 <- ageBias(scaleC~otolithC,data=WhitefishLC,min.n.CI=8, - ref.lab="Otolith Age",nref.lab="Scale Age") -plot(ab2,show.CI=TRUE,show.range=FALSE)
    - +ab2 <- ageBias(scaleC~otolithC,data=WhitefishLC,min.n.CI=8, + ref.lab="Otolith Age",nref.lab="Scale Age") +plot(ab2,show.CI=TRUE,show.range=FALSE) +
    + ############################################################# ## Differences Plot ( inspired by Bland-Altman plots in McBride (2015)) -plot(ab1,xvals="mean")
    ## Modify axis limits -plot(ab1,xvals="mean",xlim=c(1,17))
    ## Add and remove histograms -plot(ab1,xvals="mean",xHist=TRUE)
    plot(ab1,xvals="mean",xHist=TRUE,yHist=FALSE)
    plot(ab1,xvals="mean",yHist=FALSE)
    +plot(ab1,xvals="mean") +
    ## Modify axis limits +plot(ab1,xvals="mean",xlim=c(1,17)) +
    ## Add and remove histograms +plot(ab1,xvals="mean",xHist=TRUE) +
    plot(ab1,xvals="mean",xHist=TRUE,yHist=FALSE) +
    plot(ab1,xvals="mean",yHist=FALSE) +
    ############################################################# ## Adding post hoc analyses to the main plot # get original graphing parameters to be reset at the end -op <- par(no.readonly=TRUE) +op <- par(no.readonly=TRUE) # get raw data -tmp <- ab1$d -head(tmp)
    #> scaleC otolithC diff mean +tmp <- ab1$d +head(tmp) +
    #> scaleC otolithC diff mean #> 1 3 3 0 3.0 #> 2 4 3 1 3.5 #> 3 6 3 3 4.5 @@ -638,58 +669,82 @@

    Examp #> 5 3 3 0 3.0 #> 6 4 6 -2 5.0

    # Add mean difference (w/ approx. 95% CI) -bias <- mean(tmp$diff)+c(-1.96,0,1.96)*se(tmp$diff) -plot(ab1,xvals="mean",xlim=c(1,17),allowAdd=TRUE)
    abline(h=bias,lty=2,col="red")
    par(op) +bias <- mean(tmp$diff)+c(-1.96,0,1.96)*se(tmp$diff) +plot(ab1,xvals="mean",xlim=c(1,17),allowAdd=TRUE) +
    abline(h=bias,lty=2,col="red") +
    par(op) # Same as above, but without marginal histogram, and with # 95% agreement lines as well (1.96SDs) # (this is nearly a replicate of a Bland-Altman plot) -bias <- mean(tmp$diff)+c(-1.96,0,1.96)*se(tmp$diff) -agline <- mean(tmp$diff)+c(-1.96,1.96)*sd(tmp$diff) -plot(ab1,xvals="mean",yHist=FALSE,allowAdd=TRUE)
    abline(h=bias,lty=2,col="red")
    abline(h=agline,lty=3,lwd=2,col="blue")
    par(op) +bias <- mean(tmp$diff)+c(-1.96,0,1.96)*se(tmp$diff) +agline <- mean(tmp$diff)+c(-1.96,1.96)*sd(tmp$diff) +plot(ab1,xvals="mean",yHist=FALSE,allowAdd=TRUE) +
    abline(h=bias,lty=2,col="red") +
    abline(h=agline,lty=3,lwd=2,col="blue") +
    par(op) # Add linear regression line of differences on means (w/ approx. 95% CI) -lm1 <- lm(diff~mean,data=tmp) -xval <- seq(0,19,0.1) -pred1 <- predict(lm1,data.frame(mean=xval),interval="confidence") -bias1 <- data.frame(xval,pred1) -head(bias1)
    #> xval fit lwr upr +lm1 <- lm(diff~mean,data=tmp) +xval <- seq(0,19,0.1) +pred1 <- predict(lm1,data.frame(mean=xval),interval="confidence") +bias1 <- data.frame(xval,pred1) +head(bias1) +
    #> xval fit lwr upr #> 1 0.0 1.261964 0.6232456 1.900682 #> 2 0.1 1.217797 0.5861659 1.849428 #> 3 0.2 1.173630 0.5490612 1.798199 #> 4 0.3 1.129463 0.5119307 1.746995 #> 5 0.4 1.085296 0.4747735 1.695819 -#> 6 0.5 1.041129 0.4375887 1.644670
    plot(ab1,xvals="mean",xlim=c(1,17),allowAdd=TRUE)
    lines(lwr~xval,data=bias1,lty=2,col="red")
    lines(upr~xval,data=bias1,lty=2,col="red")
    lines(fit~xval,data=bias1,lty=2,col="red")
    par(op) +#> 6 0.5 1.041129 0.4375887 1.644670
    plot(ab1,xvals="mean",xlim=c(1,17),allowAdd=TRUE) +
    lines(lwr~xval,data=bias1,lty=2,col="red") +
    lines(upr~xval,data=bias1,lty=2,col="red") +
    lines(fit~xval,data=bias1,lty=2,col="red") +
    par(op) # Add loess of differences on means (w/ approx. 95% CI as a polygon) -lo2 <- loess(diff~mean,data=tmp) -xval <- seq(min(tmp$mean),max(tmp$mean),0.1) -pred2 <- predict(lo2,data.frame(mean=xval),se=TRUE) -bias2 <- data.frame(xval,pred2) -bias2$lwr <- bias2$fit-1.96*bias2$se.fit -bias2$upr <- bias2$fit+1.96*bias2$se.fit -head(bias2)
    #> xval fit se.fit residual.scale df lwr upr +lo2 <- loess(diff~mean,data=tmp) +xval <- seq(min(tmp$mean),max(tmp$mean),0.1) +pred2 <- predict(lo2,data.frame(mean=xval),se=TRUE) +bias2 <- data.frame(xval,pred2) +bias2$lwr <- bias2$fit-1.96*bias2$se.fit +bias2$upr <- bias2$fit+1.96*bias2$se.fit +head(bias2) +
    #> xval fit se.fit residual.scale df lwr upr #> 1 1.0 -0.16024844 0.5716894 1.887342 145.685 -1.2807597 0.9602628 #> 2 1.1 -0.13313237 0.5396064 1.887342 145.685 -1.1907610 0.9244962 #> 3 1.2 -0.10771932 0.5091066 1.887342 145.685 -1.1055683 0.8901296 #> 4 1.3 -0.08401421 0.4802391 1.887342 145.685 -1.0252828 0.8572543 #> 5 1.4 -0.06202196 0.4530549 1.887342 145.685 -0.9500096 0.8259657 -#> 6 1.5 -0.04174751 0.4276065 1.887342 145.685 -0.8798563 0.7963613
    plot(ab1,xvals="mean",xlim=c(1,17),allowAdd=TRUE)
    with(bias2,polygon(c(xval,rev(xval)),c(lwr,rev(upr)), - col=col2rgbt("red",1/10),border=NA))
    lines(fit~xval,data=bias2,lty=2,col="red")
    par(op) - +#> 6 1.5 -0.04174751 0.4276065 1.887342 145.685 -0.8798563 0.7963613
    plot(ab1,xvals="mean",xlim=c(1,17),allowAdd=TRUE) +
    with(bias2,polygon(c(xval,rev(xval)),c(lwr,rev(upr)), + col=col2rgbt("red",1/10),border=NA)) +
    lines(fit~xval,data=bias2,lty=2,col="red") +
    par(op) + # Same as above, but polygon and line behind the points -plot(ab1,xvals="mean",xlim=c(1,17),col.pts="white",allowAdd=TRUE)
    with(bias2,polygon(c(xval,rev(xval)),c(lwr,rev(upr)), - col=col2rgbt("red",1/10),border=NA))
    lines(fit~xval,data=bias2,lty=2,col="red")
    points(diff~mean,data=tmp,pch=19,col=col2rgbt("black",1/8))
    par(op) +plot(ab1,xvals="mean",xlim=c(1,17),col.pts="white",allowAdd=TRUE) +
    with(bias2,polygon(c(xval,rev(xval)),c(lwr,rev(upr)), + col=col2rgbt("red",1/10),border=NA)) +
    lines(fit~xval,data=bias2,lty=2,col="red") +
    points(diff~mean,data=tmp,pch=19,col=col2rgbt("black",1/8)) +
    par(op) # Can also be made with the reference ages on the x-axis -lo3 <- loess(diff~otolithC,data=tmp) -xval <- seq(min(tmp$otolithC),max(tmp$otolithC),0.1) -pred3 <- predict(lo3,data.frame(otolithC=xval),se=TRUE) -bias3 <- data.frame(xval,pred3) -bias3$lwr <- bias3$fit-1.96*bias3$se.fit -bias3$upr <- bias3$fit+1.96*bias3$se.fit -plot(ab1,show.range=FALSE,show.pts=TRUE,col.pts="white",allowAdd=TRUE)
    with(bias3,polygon(c(xval,rev(xval)),c(lwr,rev(upr)), - col=col2rgbt("red",1/10),border=NA))
    lines(fit~xval,data=bias3,lty=2,col="red")
    points(diff~otolithC,data=tmp,pch=19,col=col2rgbt("black",1/8))
    par(op)
    +lo3 <- loess(diff~otolithC,data=tmp) +xval <- seq(min(tmp$otolithC),max(tmp$otolithC),0.1) +pred3 <- predict(lo3,data.frame(otolithC=xval),se=TRUE) +bias3 <- data.frame(xval,pred3) +bias3$lwr <- bias3$fit-1.96*bias3$se.fit +bias3$upr <- bias3$fit+1.96*bias3$se.fit +plot(ab1,show.range=FALSE,show.pts=TRUE,col.pts="white",allowAdd=TRUE) +
    with(bias3,polygon(c(xval,rev(xval)),c(lwr,rev(upr)), + col=col2rgbt("red",1/10),border=NA)) +
    lines(fit~xval,data=bias3,lty=2,col="red") +
    points(diff~otolithC,data=tmp,pch=19,col=col2rgbt("black",1/8)) +
    par(op) + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/agePrecision-1.png b/docs/reference/agePrecision-1.png index 2a4d1146..bbcdf2f9 100644 Binary files a/docs/reference/agePrecision-1.png and b/docs/reference/agePrecision-1.png differ diff --git a/docs/reference/agePrecision-10.png b/docs/reference/agePrecision-10.png index 245a1047..7e0b1512 100644 Binary files a/docs/reference/agePrecision-10.png and b/docs/reference/agePrecision-10.png differ diff --git a/docs/reference/agePrecision-2.png b/docs/reference/agePrecision-2.png index 9f8dbeb9..6a5e6ee6 100644 Binary files a/docs/reference/agePrecision-2.png and b/docs/reference/agePrecision-2.png differ diff --git a/docs/reference/agePrecision-3.png b/docs/reference/agePrecision-3.png index a3e1384d..8bdc96be 100644 Binary files a/docs/reference/agePrecision-3.png and b/docs/reference/agePrecision-3.png differ diff --git a/docs/reference/agePrecision-4.png b/docs/reference/agePrecision-4.png index 1c792b5a..b0de127d 100644 Binary files a/docs/reference/agePrecision-4.png and b/docs/reference/agePrecision-4.png differ diff --git a/docs/reference/agePrecision-5.png b/docs/reference/agePrecision-5.png index 71612f7c..c89fdaf8 100644 Binary files a/docs/reference/agePrecision-5.png and b/docs/reference/agePrecision-5.png differ diff --git a/docs/reference/agePrecision-6.png b/docs/reference/agePrecision-6.png index a810b108..c146b27a 100644 Binary files a/docs/reference/agePrecision-6.png and b/docs/reference/agePrecision-6.png differ diff --git a/docs/reference/agePrecision-7.png b/docs/reference/agePrecision-7.png index c8b3f82c..c4beb95c 100644 Binary files a/docs/reference/agePrecision-7.png and b/docs/reference/agePrecision-7.png differ diff --git a/docs/reference/agePrecision-8.png b/docs/reference/agePrecision-8.png index e2b3beeb..5f85b4dd 100644 Binary files a/docs/reference/agePrecision-8.png and b/docs/reference/agePrecision-8.png differ diff --git a/docs/reference/agePrecision-9.png b/docs/reference/agePrecision-9.png index b7ff99ed..9fb113d0 100644 Binary files a/docs/reference/agePrecision-9.png and b/docs/reference/agePrecision-9.png differ diff --git a/docs/reference/agePrecision.html b/docs/reference/agePrecision.html index 764716bb..52c73d98 100644 --- a/docs/reference/agePrecision.html +++ b/docs/reference/agePrecision.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,18 +128,18 @@

    Compute measures of precision among sets of ages.

    Computes overall measures of precision for multiple age estimates made on the same individuals. Ages may be from two or more readers of the same structure, one reader at two or more times, or two or more structures (e.g., scales, spines, otoliths). Measures of precision include ACV (Average Coefficient of Variation), APE (Average Percent Error), AAD (Average Absolute Deviation), and ASD (Average Standard Devation), and various percentage difference values.

    -
    agePrecision(formula, data)
    +    
    agePrecision(formula, data)
     
     # S3 method for agePrec
    -summary(
    -  object,
    -  what = c("precision", "difference", "absolute difference", "details"),
    -  percent = TRUE,
    -  trunc.diff = NULL,
    -  digits = 4,
    -  show.prec2 = FALSE,
    -  ...
    -)
    +summary( + object, + what = c("precision", "difference", "absolute difference", "details"), + percent = TRUE, + trunc.diff = NULL, + digits = 4, + show.prec2 = FALSE, + ... +)

    Arguments

    @@ -209,10 +209,10 @@

    Details
  • R Number of age estimates given in formula.

  • PercAgree The percentage of fish for which all age estimates perfectly agree.

  • ASD The average (across all fish) standard deviation of ages within a fish.

  • -
  • ACV The average (across all fish) coefficient of variation of ages within a fish using the mean as the divisor. See the IFAR chapter for calculation details.

  • +
  • ACV The average (across all fish) coefficient of variation of ages within a fish using the mean as the divisor. See the IFAR chapter for calculation details.

  • ACV2 The average (across all fish) coefficient of variation of ages within a fish using the median as the divisor. This will only be shown if R>2 or show.prec2=TRUE.

  • AAD The average (across all fish) absolute deviation of ages within a fish.

  • -
  • APE The average (across all fish) percent error of ages within a fish using the mean as the divisor. See the IFAR chapter for calculation details.

  • +
  • APE The average (across all fish) percent error of ages within a fish using the mean as the divisor. See the IFAR chapter for calculation details.

  • APE2 The average (across all fish) percent error of ages within a fish using the median as the divisor. This will only be shown if R>2 or show.prec2=TRUE.

  • AD The average (across all fish) index of precision (D).

  • @@ -230,7 +230,7 @@

    <

    4-Age Comparisons.

    References

    -

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

    +

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

    Beamish, R.J. and D.A. Fournier. 1981. A method for comparing the precision of a set of age determinations. Canadian Journal of Fisheries and Aquatic Sciences 38:982-983. [Was (is?) available from http://www.pac.dfo-mpo.gc.ca/science/people-gens/beamish/PDF_files/compareagecjfas1981.pdf.]

    Campana, S.E. 1982. Accuracy, precision and quality control in age determination, including a review of the use and abuse of age validation methods. Journal of Fish Biology 59:197-242. [Was (is?) available from http://www.denix.osd.mil/nr/crid/Coral_Reef_Iniative_Database/References_for_Reef_Assessment_files/Campana,%202001.pdf.]

    Campana, S.E., M.C. Annand, and J.I. McMillan. 1995. Graphical and statistical methods for determining the consistency of age determinations. Transactions of the American Fisheries Society 124:131-138. [Was (is?) available from http://www.bio.gc.ca/otoliths/documents/Campana%20et%20al%201995%20TAFS.pdf.]

    @@ -239,11 +239,15 @@

    R

    See also

    See ageBias for computation of the full age agreement table, along with tests and plots of age bias.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Example with just two age estimates -ap1 <- agePrecision(~otolithC+scaleC,data=WhitefishLC) -summary(ap1)
    #> Precision summary statistics +ap1 <- agePrecision(~otolithC+scaleC,data=WhitefishLC) +summary(ap1) +
    #> Precision summary statistics #> n validn R PercAgree ASD ACV AAD APE #> 151 151 2 19.87 1.541 21.11 1.089 14.93 #> @@ -565,17 +569,24 @@

    Examp #> 148 39.394 #> 149 3.226 #> 150 25.000 -#> 151 36.842

    summary(ap1,what="precision")
    #> n validn R PercAgree ASD ACV AAD APE -#> 151 151 2 19.87 1.541 21.11 1.089 14.93
    summary(ap1,what="difference")
    #> -3 -2 -1 0 1 2 3 4 5 6 +#> 151 36.842
    summary(ap1,what="precision") +
    #> n validn R PercAgree ASD ACV AAD APE +#> 151 151 2 19.87 1.541 21.11 1.089 14.93
    summary(ap1,what="difference") +
    #> -3 -2 -1 0 1 2 3 4 5 6 #> 2.6490 0.6623 10.5960 19.8675 19.8675 15.8940 11.2583 5.9603 3.3113 5.2980 #> 7 8 9 10 11 12 13 -#> 1.9868 1.3245 0.0000 0.0000 0.6623 0.0000 0.6623
    summary(ap1,what="difference",percent=FALSE)
    #> -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 -#> 4 1 16 30 30 24 17 9 5 8 3 2 0 0 1 0 1
    summary(ap1,what="absolute")
    #> 0 1 2 3 4 5 6 7 8 9 +#> 1.9868 1.3245 0.0000 0.0000 0.6623 0.0000 0.6623
    summary(ap1,what="difference",percent=FALSE) +
    #> -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 +#> 4 1 16 30 30 24 17 9 5 8 3 2 0 0 1 0 1
    summary(ap1,what="absolute") +
    #> 0 1 2 3 4 5 6 7 8 9 #> 19.8675 30.4636 16.5563 13.9073 5.9603 3.3113 5.2980 1.9868 1.3245 0.0000 #> 10 11 12 13 -#> 0.0000 0.6623 0.0000 0.6623
    summary(ap1,what="absolute",percent=FALSE)
    #> 0 1 2 3 4 5 6 7 8 9 10 11 12 13 -#> 30 46 25 21 9 5 8 3 2 0 0 1 0 1
    summary(ap1,what="absolute",trunc.diff=4)
    #> 0 1 2 3 4+ -#> 19.87 30.46 16.56 13.91 19.21
    summary(ap1,what=c("precision","difference"))
    #> Precision summary statistics +#> 0.0000 0.6623 0.0000 0.6623
    summary(ap1,what="absolute",percent=FALSE) +
    #> 0 1 2 3 4 5 6 7 8 9 10 11 12 13 +#> 30 46 25 21 9 5 8 3 2 0 0 1 0 1
    summary(ap1,what="absolute",trunc.diff=4) +
    #> 0 1 2 3 4+ +#> 19.87 30.46 16.56 13.91 19.21
    summary(ap1,what=c("precision","difference")) +
    #> Precision summary statistics #> n validn R PercAgree ASD ACV AAD APE #> 151 151 2 19.87 1.541 21.11 1.089 14.93 #> @@ -584,7 +595,8 @@

    Examp #> -3 -2 -1 0 1 2 3 4 5 6 #> 2.6490 0.6623 10.5960 19.8675 19.8675 15.8940 11.2583 5.9603 3.3113 5.2980 #> 7 8 9 10 11 12 13 -#> 1.9868 1.3245 0.0000 0.0000 0.6623 0.0000 0.6623

    summary(ap1,what="detail")
    #> otolithC scaleC mean median mode SD CV CV2 AD PE PE2 +#> 1.9868 1.3245 0.0000 0.0000 0.6623 0.0000 0.6623
    summary(ap1,what="detail") +
    #> otolithC scaleC mean median mode SD CV CV2 AD PE PE2 #> 1 3 3 3.0 3.0 3 0.0000 0.000 0.000 0.0 0.000 0.000 #> 2 3 4 3.5 3.5 NA 0.7071 20.203 20.203 0.5 14.286 14.286 #> 3 3 6 4.5 4.5 NA 2.1213 47.140 47.140 1.5 33.333 33.333 @@ -888,14 +900,20 @@

    Examp #> 149 3.226 #> 150 25.000 #> 151 36.842

    -barplot(ap1$rawdiff,ylab="Frequency",xlab="Otolith - Scale Age")
    plot(AD~mean,data=ap1$detail,pch=19,col=col2rgbt("black",1/5), - xlab="Mean Age",ylab="Absolute Deviation Age")
    plot(SD~mean,data=ap1$detail,pch=19,col=col2rgbt("black",1/5), - xlab="Mean Age",ylab="Standard deviation Age")
    plot(SD~AD,data=ap1$detail,pch=19,col=col2rgbt("black",1/5), - xlab="Absolute Deviation Age",ylab="Standard deviation Age")
    plot(CV~PE,data=ap1$detail,pch=19,col=col2rgbt("black",1/5), - xlab="Percent Error Age",ylab="Coefficient of Variation Age")
    +barplot(ap1$rawdiff,ylab="Frequency",xlab="Otolith - Scale Age") +
    plot(AD~mean,data=ap1$detail,pch=19,col=col2rgbt("black",1/5), + xlab="Mean Age",ylab="Absolute Deviation Age") +
    plot(SD~mean,data=ap1$detail,pch=19,col=col2rgbt("black",1/5), + xlab="Mean Age",ylab="Standard deviation Age") +
    plot(SD~AD,data=ap1$detail,pch=19,col=col2rgbt("black",1/5), + xlab="Absolute Deviation Age",ylab="Standard deviation Age") +
    plot(CV~PE,data=ap1$detail,pch=19,col=col2rgbt("black",1/5), + xlab="Percent Error Age",ylab="Coefficient of Variation Age") +
    ## Example with three age estimates -ap2 <- agePrecision(~otolithC+finrayC+scaleC,data=WhitefishLC) -summary(ap2,digits=3)
    #> Precision summary statistics +ap2 <- agePrecision(~otolithC+finrayC+scaleC,data=WhitefishLC) +summary(ap2,digits=3) +
    #> Precision summary statistics #> n validn R PercAgree ASD ACV ACV2 AAD APE APE2 AD #> 151 151 3 12.6 1.49 21.8 27.5 1.1 16.2 14.8 12.6 #> @@ -1229,8 +1247,10 @@

    Examp #> 148 46.67 32.21 #> 149 4.44 3.85 #> 150 20.00 16.38 -#> 151 29.17 23.13

    summary(ap2,what="precision")
    #> n validn R PercAgree ASD ACV ACV2 AAD APE APE2 AD -#> 151 151 3 12.58 1.487 21.77 27.52 1.104 16.19 14.76 12.57
    summary(ap2,what="difference")
    #> -4 -3 -2 -1 0 1 2 +#> 151 29.17 23.13
    summary(ap2,what="precision") +
    #> n validn R PercAgree ASD ACV ACV2 AAD APE APE2 AD +#> 151 151 3 12.58 1.487 21.77 27.52 1.104 16.19 14.76 12.57
    summary(ap2,what="difference") +
    #> -4 -3 -2 -1 0 1 2 #> otolithC - finrayC 0.0000 0.0000 1.3245 3.3113 24.5033 17.8808 16.5563 #> otolithC - scaleC 0.0000 2.6490 0.6623 10.5960 19.8675 19.8675 15.8940 #> finrayC - scaleC 3.3113 4.6358 12.5828 19.8675 40.3974 14.5695 2.6490 @@ -1241,10 +1261,12 @@

    Examp #> 10 11 12 13 14 #> otolithC - finrayC 0.0000 0.6623 0.0000 0.0000 0.6623 #> otolithC - scaleC 0.0000 0.6623 0.0000 0.6623 0.0000 -#> finrayC - scaleC 0.0000 0.0000 0.0000 0.0000 0.0000

    summary(ap2,what="absolute",percent=FALSE,trunc.diff=4)
    #> 0 1 2 3 4+ +#> finrayC - scaleC 0.0000 0.0000 0.0000 0.0000 0.0000
    summary(ap2,what="absolute",percent=FALSE,trunc.diff=4) +
    #> 0 1 2 3 4+ #> otolithC v. finrayC 37 32 27 18 37 #> otolithC v. scaleC 30 46 25 21 29 -#> finrayC v. scaleC 61 52 23 8 7
    summary(ap2,what="detail",digits=3)
    #> otolithC finrayC scaleC mean median mode SD CV CV2 AD PE +#> finrayC v. scaleC 61 52 23 8 7
    summary(ap2,what="detail",digits=3) +
    #> otolithC finrayC scaleC mean median mode SD CV CV2 AD PE #> 1 3 3 3 3.00 3 3 0.000 0.00 0.00 0.000 0.00 #> 2 3 3 4 3.33 3 3 0.577 17.32 23.57 0.444 13.33 #> 3 3 3 6 4.00 3 3 1.732 43.30 70.71 1.333 33.33 @@ -1548,12 +1570,17 @@

    Examp #> 149 4.44 3.85 #> 150 20.00 16.38 #> 151 29.17 23.13

    -plot(AD~mean,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), - xlab="Mean Age",ylab="Absolute Deviation Age")
    plot(SD~mean,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), - xlab="Mean Age",ylab="Standard Deviation Age")
    plot(SD~AD,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), - xlab="Absolute Deviation Age",ylab="Standard Deviation Age")
    plot(CV~PE,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), - xlab="Percent Error Age",ylab="Coefficient of Variation Age")
    plot(median~mean,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), - xlab="Mean Age",ylab="Median Age")
    +plot(AD~mean,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), + xlab="Mean Age",ylab="Absolute Deviation Age") +
    plot(SD~mean,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), + xlab="Mean Age",ylab="Standard Deviation Age") +
    plot(SD~AD,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), + xlab="Absolute Deviation Age",ylab="Standard Deviation Age") +
    plot(CV~PE,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), + xlab="Percent Error Age",ylab="Coefficient of Variation Age") +
    plot(median~mean,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), + xlab="Mean Age",ylab="Median Age") +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/alkAgeDist.html b/docs/reference/alkAgeDist.html index cca567d1..c1f39a5f 100644 --- a/docs/reference/alkAgeDist.html +++ b/docs/reference/alkAgeDist.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Proportions-at-age from an age-length key

    Computes the proportions-at-age (with standard errors) in a larger sample based on an age-length-key created from a subsample of ages through a two-stage random sampling design. Follows the methods in Quinn and Deriso (1999).

    -
    alkAgeDist(key, lenA.n, len.n)
    +
    alkAgeDist(key, lenA.n, len.n)

    Arguments

    @@ -168,27 +168,31 @@

    <

    5-Age-Length Key.

    References

    -

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

    +

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

    Lai, H.-L. 1987. Optimum allocation for estimating age composition using age-length key. Fishery Bulletin, 85:179-185.

    Lai, H.-L. 1993. Optimum sampling design for using the age-length key to estimate age composition of a fish population. Fishery Bulletin, 92:382-388.

    Quinn, T. J. and R. B. Deriso. 1999. Quantitative Fish Dynamics. Oxford University Press, New York, New York. 542 pages.

    See also

    See alkIndivAge and related functions for a completely different methodology. See alkprop from fishmethods for the exact same methodology but with a different format for the inputs.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Example -- Even breaks for length categories -WR1 <- WR79 +WR1 <- WR79 # add length intervals (width=5) -WR1$LCat <- lencat(WR1$len,w=5) +WR1$LCat <- lencat(WR1$len,w=5) # get number of fish in each length interval in the entire sample -len.n <- xtabs(~LCat,data=WR1) +len.n <- xtabs(~LCat,data=WR1) # isolate aged sample and get number in each length interval -WR1.age <- subset(WR1, !is.na(age)) -lenA.n <- xtabs(~LCat,data=WR1.age) +WR1.age <- subset(WR1, !is.na(age)) +lenA.n <- xtabs(~LCat,data=WR1.age) # create age-length key -raw <- xtabs(~LCat+age,data=WR1.age) -( WR1.key <- prop.table(raw, margin=1) )
    #> age +raw <- xtabs(~LCat+age,data=WR1.age) +( WR1.key <- prop.table(raw, margin=1) ) +
    #> age #> LCat 4 5 6 7 8 9 #> 35 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 #> 40 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 @@ -227,7 +231,8 @@

    Examp #> 110 0.20000000 0.20000000 #> 115 1.00000000 0.00000000

    # use age-length key to estimate age distribution of all fish -alkAgeDist(WR1.key,lenA.n,len.n)
    #> age prop se +alkAgeDist(WR1.key,lenA.n,len.n) +
    #> age prop se #> 1 4 0.416378219 0.013206893 #> 2 5 0.167201351 0.013907259 #> 3 6 0.113882857 0.014938965 @@ -252,7 +257,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/alkIndivAge.html b/docs/reference/alkIndivAge.html index 01e8ddf0..6715866d 100644 --- a/docs/reference/alkIndivAge.html +++ b/docs/reference/alkIndivAge.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,14 +128,14 @@

    Use an age-length key to assign age to individuals in the unaged sample.

    Use either the semi- or completely-random methods from Isermann and Knight (2005) to assign ages to individual fish in the unaged sample according to the information in an age-length key supplied by the user.

    -
    alkIndivAge(
    -  key,
    -  formula,
    -  data,
    -  type = c("SR", "CR"),
    -  breaks = NULL,
    -  seed = NULL
    -)
    +
    alkIndivAge(
    +  key,
    +  formula,
    +  data,
    +  type = c("SR", "CR"),
    +  breaks = NULL,
    +  seed = NULL
    +)

    Arguments

    @@ -154,7 +154,7 @@

    Arg

    - + @@ -183,30 +183,35 @@

    <

    5-Age-Length Key.

    References

    -

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

    +

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

    Isermann, D.A. and C.T. Knight. 2005. A computer program for age-length keys incorporating age assignment to individual fish. North American Journal of Fisheries Management, 25:1153-1160. [Was (is?) from http://www.tandfonline.com/doi/abs/10.1577/M04-130.1.]

    See also

    See alkAgeDist and alkMeanVar for alternative methods to derived age distributions and mean (and SD) values for each age. See alkPlot for methods to visualize age-length keys.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com. This is largely an R version of the SAS code provided by Isermann and Knight (2005).

    Examples

    ## First Example -- Even breaks for length categories -WR1 <- WR79 +WR1 <- WR79 # add length categories (width=5) -WR1$LCat <- lencat(WR1$len,w=5) +WR1$LCat <- lencat(WR1$len,w=5) # isolate aged and unaged samples -WR1.age <- subset(WR1, !is.na(age)) -WR1.len <- subset(WR1, is.na(age)) +WR1.age <- subset(WR1, !is.na(age)) +WR1.len <- subset(WR1, is.na(age)) # note no ages in unaged sample -head(WR1.len)
    #> ID len age LCat +head(WR1.len) +
    #> ID len age LCat #> 1 1 37 NA 35 #> 2 2 37 NA 35 #> 3 3 39 NA 35 #> 4 4 37 NA 35 #> 7 7 42 NA 40 #> 8 8 42 NA 40
    # create age-length key -raw <- xtabs(~LCat+age,data=WR1.age) -( WR1.key <- prop.table(raw, margin=1) )
    #> age +raw <- xtabs(~LCat+age,data=WR1.age) +( WR1.key <- prop.table(raw, margin=1) ) +
    #> age #> LCat 4 5 6 7 8 9 #> 35 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 #> 40 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 @@ -244,18 +249,20 @@

    Examp #> 105 0.14285714 0.00000000 #> 110 0.20000000 0.20000000 #> 115 1.00000000 0.00000000

    # apply the age-length key -WR1.len <- alkIndivAge(WR1.key,age~len,data=WR1.len) +WR1.len <- alkIndivAge(WR1.key,age~len,data=WR1.len) # now there are ages -head(WR1.len)
    #> ID len age LCat +head(WR1.len) +
    #> ID len age LCat #> 1 1 37 4 35 #> 2 2 37 4 35 #> 3 3 39 4 35 #> 4 4 37 4 35 #> 7 7 42 4 40 #> 8 8 42 4 40
    # combine orig age & new ages -WR1.comb <- rbind(WR1.age, WR1.len) +WR1.comb <- rbind(WR1.age, WR1.len) # mean length-at-age -Summarize(len~age,data=WR1.comb,digits=2)
    #> age n mean sd min Q1 median Q3 max +Summarize(len~age,data=WR1.comb,digits=2) +
    #> age n mean sd min Q1 median Q3 max #> 1 4 986 51.86 5.15 35 48.00 52.0 56.00 64 #> 2 5 396 71.74 5.37 60 68.00 72.0 76.00 84 #> 3 6 270 86.63 4.61 75 83.00 87.0 89.00 98 @@ -264,26 +271,29 @@

    Examp #> 6 9 78 103.90 3.35 100 101.25 103.0 105.75 113 #> 7 10 38 105.03 7.17 95 98.00 106.5 109.75 119 #> 8 11 6 111.67 1.21 110 111.00 111.5 112.75 113

    # age frequency distribution -( af <- xtabs(~age,data=WR1.comb) )
    #> age +( af <- xtabs(~age,data=WR1.comb) ) +
    #> age #> 4 5 6 7 8 9 10 11 #> 986 396 270 449 146 78 38 6
    # proportional age distribution -( ap <- prop.table(af) )
    #> age +( ap <- prop.table(af) ) +
    #> age #> 4 5 6 7 8 9 #> 0.416209371 0.167159139 0.113972140 0.189531448 0.061629379 0.032925285 #> 10 11 #> 0.016040523 0.002532714
    ## Second Example -- length sample does not have an age variable -WR2 <- WR79 +WR2 <- WR79 # isolate age and unaged samples -WR2.age <- subset(WR2, !is.na(age)) -WR2.len <- subset(WR2, is.na(age)) +WR2.age <- subset(WR2, !is.na(age)) +WR2.len <- subset(WR2, is.na(age)) # remove age variable (for demo only) -WR2.len <- WR2.len[,-3] +WR2.len <- WR2.len[,-3] # add length categories to aged sample -WR2.age$LCat <- lencat(WR2.age$len,w=5) +WR2.age$LCat <- lencat(WR2.age$len,w=5) # create age-length key -raw <- xtabs(~LCat+age,data=WR2.age) -( WR2.key <- prop.table(raw, margin=1) )
    #> age +raw <- xtabs(~LCat+age,data=WR2.age) +( WR2.key <- prop.table(raw, margin=1) ) +
    #> age #> LCat 4 5 6 7 8 9 #> 35 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 #> 40 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 @@ -321,18 +331,20 @@

    Examp #> 105 0.14285714 0.00000000 #> 110 0.20000000 0.20000000 #> 115 1.00000000 0.00000000

    # apply the age-length key -WR2.len <- alkIndivAge(WR2.key,~len,data=WR2.len) +WR2.len <- alkIndivAge(WR2.key,~len,data=WR2.len) # add length cat to length sample -WR2.len$LCat <- lencat(WR2.len$len,w=5) -head(WR2.len)
    #> ID len age LCat +WR2.len$LCat <- lencat(WR2.len$len,w=5) +head(WR2.len) +
    #> ID len age LCat #> 1 1 37 4 35 #> 2 2 37 4 35 #> 3 3 39 4 35 #> 4 4 37 4 35 #> 7 7 42 4 40 #> 8 8 42 4 40
    # combine orig age & new ages -WR2.comb <- rbind(WR2.age, WR2.len) -Summarize(len~age,data=WR2.comb,digits=2)
    #> age n mean sd min Q1 median Q3 max +WR2.comb <- rbind(WR2.age, WR2.len) +Summarize(len~age,data=WR2.comb,digits=2) +
    #> age n mean sd min Q1 median Q3 max #> 1 4 986 51.84 5.12 35 48 52.0 56.00 64 #> 2 5 396 71.78 5.32 60 68 72.0 76.00 84 #> 3 6 270 86.73 4.78 75 83 87.0 89.00 99 @@ -342,20 +354,22 @@

    Examp #> 7 10 38 104.87 7.17 95 97 106.5 109.75 119 #> 8 11 6 112.00 1.55 110 111 112.0 113.00 114

    ## Third Example -- Uneven breaks for length categories -WR3 <- WR79 +WR3 <- WR79 # set up uneven breaks -brks <- c(seq(35,100,5),110,130) -WR3$LCat <- lencat(WR3$len,breaks=brks) -WR3.age <- subset(WR3, !is.na(age)) -WR3.len <- subset(WR3, is.na(age)) -head(WR3.len)
    #> ID len age LCat +brks <- c(seq(35,100,5),110,130) +WR3$LCat <- lencat(WR3$len,breaks=brks) +WR3.age <- subset(WR3, !is.na(age)) +WR3.len <- subset(WR3, is.na(age)) +head(WR3.len) +
    #> ID len age LCat #> 1 1 37 NA 35 #> 2 2 37 NA 35 #> 3 3 39 NA 35 #> 4 4 37 NA 35 #> 7 7 42 NA 40 -#> 8 8 42 NA 40
    raw <- xtabs(~LCat+age,data=WR3.age) -( WR3.key <- prop.table(raw, margin=1) )
    #> age +#> 8 8 42 NA 40
    raw <- xtabs(~LCat+age,data=WR3.age) +( WR3.key <- prop.table(raw, margin=1) ) +
    #> age #> LCat 4 5 6 7 8 9 #> 35 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 #> 40 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 @@ -388,16 +402,19 @@

    Examp #> 90 0.00000000 0.00000000 #> 95 0.05882353 0.00000000 #> 100 0.04000000 0.00000000 -#> 110 0.42857143 0.14285714

    WR3.len <- alkIndivAge(WR3.key,age~len,data=WR3.len,breaks=brks)
    #> Warning: The maximum observed length in the length sample (117) is greater +#> 110 0.42857143 0.14285714
    WR3.len <- alkIndivAge(WR3.key,age~len,data=WR3.len,breaks=brks) +
    #> Warning: The maximum observed length in the length sample (117) is greater #> than the largest length category in the age-length key (110). -#> The last length category will be treated as all-inclusive.
    head(WR3.len)
    #> ID len age LCat +#> The last length category will be treated as all-inclusive.
    head(WR3.len) +
    #> ID len age LCat #> 1 1 37 4 35 #> 2 2 37 4 35 #> 3 3 39 4 35 #> 4 4 37 4 35 #> 7 7 42 4 40 -#> 8 8 42 4 40
    WR3.comb <- rbind(WR3.age, WR3.len) -Summarize(len~age,data=WR3.comb,digits=2)
    #> age n mean sd min Q1 median Q3 max +#> 8 8 42 4 40
    WR3.comb <- rbind(WR3.age, WR3.len) +Summarize(len~age,data=WR3.comb,digits=2) +
    #> age n mean sd min Q1 median Q3 max #> 1 4 986 51.85 5.13 35 48.00 52.0 56 64 #> 2 5 396 71.73 5.28 60 68.00 72.0 76 84 #> 3 6 271 86.80 4.69 75 83.00 87.0 89 99 @@ -422,7 +439,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/alkMeanVar.html b/docs/reference/alkMeanVar.html index 2b7e064f..276a87e2 100644 --- a/docs/reference/alkMeanVar.html +++ b/docs/reference/alkMeanVar.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,13 +128,13 @@

    Mean Values-at-age from an age-length key

    Computes the mean value-at-age in a larger sample based on an age-length-key created from a subsample of ages through a two-stage random sampling design. The mean values could be mean length-, weight-, or fecundity-at-age, for example. The methods of Bettoli and Miranda (2001) or Quinn and Deriso (1999) are used. A standard deviation is computed for the Bettoli and Miranda (2001) method and standard error for the Quinn and Deriso (1999) method. See the testing section notes.

    -
    alkMeanVar(
    -  key,
    -  formula,
    -  data,
    -  len.n,
    -  method = c("BettoliMiranda", "QuinnDeriso")
    -)
    +
    alkMeanVar(
    +  key,
    +  formula,
    +  data,
    +  len.n,
    +  method = c("BettoliMiranda", "QuinnDeriso")
    +)

    Arguments

    type

    A string that indicates whether to use the semi-random (type="SR", default) or completely-random (type="CR") methods for assigning ages to individual fish. See the IFAR chapter for more details.

    A string that indicates whether to use the semi-random (type="SR", default) or completely-random (type="CR") methods for assigning ages to individual fish. See the IFAR chapter for more details.

    breaks
    @@ -182,25 +182,29 @@

    <

    5-Age-Length Key.

    References

    -

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

    +

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

    Bettoli, P. W. and Miranda, L. E. 2001. A cautionary note about estimating mean length at age with subsampled data. North American Journal of Fisheries Management, 21:425-428.

    Quinn, T. J. and R. B. Deriso. 1999. Quantitative Fish Dynamics. Oxford University Press, New York, New York. 542 pages

    See also

    See alkIndivAge and related functions for a completely different methodology. See alkAgeDist for a related method of determining the proportion of fish at each age. See the ALKr package.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Example -- Even breaks for length categories -WR1 <- WR79 +WR1 <- WR79 # add length intervals (width=5) -WR1$LCat <- lencat(WR1$len,w=5) +WR1$LCat <- lencat(WR1$len,w=5) # get number of fish in each length interval in the entire sample -len.n <- xtabs(~LCat,data=WR1) +len.n <- xtabs(~LCat,data=WR1) # isolate aged sample -WR1.age <- subset(WR1, !is.na(age)) +WR1.age <- subset(WR1, !is.na(age)) # create age-length key -raw <- xtabs(~LCat+age,data=WR1.age) -( WR1.key <- prop.table(raw, margin=1) )
    #> age +raw <- xtabs(~LCat+age,data=WR1.age) +( WR1.key <- prop.table(raw, margin=1) ) +
    #> age #> LCat 4 5 6 7 8 9 #> 35 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 #> 40 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 @@ -240,7 +244,8 @@

    Examp #> 115 1.00000000 0.00000000

    ## use age-length key to estimate mean length-at-age of all fish # Bettoli-Miranda method -alkMeanVar(WR1.key,len~LCat+age,WR1.age,len.n)
    #> age mean sd +alkMeanVar(WR1.key,len~LCat+age,WR1.age,len.n) +
    #> age mean sd #> 1 4 51.95492 5.050430 #> 2 5 72.01342 5.519135 #> 3 6 86.59311 4.714664 @@ -250,7 +255,8 @@

    Examp #> 7 10 104.86056 7.497515 #> 8 11 113.00000 0.000000

    # Quinn-Deriso method -alkMeanVar(WR1.key,len~LCat+age,WR1.age,len.n,method="QuinnDeriso")
    #> The 'se' values should not be trusted!
    #> age mean se +alkMeanVar(WR1.key,len~LCat+age,WR1.age,len.n,method="QuinnDeriso") +
    #> The 'se' values should not be trusted!
    #> age mean se #> 1 4 51.95492 0.3031374 #> 2 5 72.01342 0.5018225 #> 3 6 86.59311 0.5977608 @@ -275,7 +281,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/alkPlot-1.png b/docs/reference/alkPlot-1.png index a8c9d51a..4a856d03 100644 Binary files a/docs/reference/alkPlot-1.png and b/docs/reference/alkPlot-1.png differ diff --git a/docs/reference/alkPlot-10.png b/docs/reference/alkPlot-10.png index 7d82bf9a..8fc18792 100644 Binary files a/docs/reference/alkPlot-10.png and b/docs/reference/alkPlot-10.png differ diff --git a/docs/reference/alkPlot-11.png b/docs/reference/alkPlot-11.png index 80fca059..28e0dc77 100644 Binary files a/docs/reference/alkPlot-11.png and b/docs/reference/alkPlot-11.png differ diff --git a/docs/reference/alkPlot-12.png b/docs/reference/alkPlot-12.png index c86dd897..b3b7e2c6 100644 Binary files a/docs/reference/alkPlot-12.png and b/docs/reference/alkPlot-12.png differ diff --git a/docs/reference/alkPlot-13.png b/docs/reference/alkPlot-13.png index ee640eea..f7688d42 100644 Binary files a/docs/reference/alkPlot-13.png and b/docs/reference/alkPlot-13.png differ diff --git a/docs/reference/alkPlot-14.png b/docs/reference/alkPlot-14.png index 03998f83..7f74c504 100644 Binary files a/docs/reference/alkPlot-14.png and b/docs/reference/alkPlot-14.png differ diff --git a/docs/reference/alkPlot-15.png b/docs/reference/alkPlot-15.png index 0014550a..63def49b 100644 Binary files a/docs/reference/alkPlot-15.png and b/docs/reference/alkPlot-15.png differ diff --git a/docs/reference/alkPlot-16.png b/docs/reference/alkPlot-16.png index 4c54cdd8..a2513c3b 100644 Binary files a/docs/reference/alkPlot-16.png and b/docs/reference/alkPlot-16.png differ diff --git a/docs/reference/alkPlot-2.png b/docs/reference/alkPlot-2.png index 37b6ac33..99392ac7 100644 Binary files a/docs/reference/alkPlot-2.png and b/docs/reference/alkPlot-2.png differ diff --git a/docs/reference/alkPlot-3.png b/docs/reference/alkPlot-3.png index 45668169..df93fa15 100644 Binary files a/docs/reference/alkPlot-3.png and b/docs/reference/alkPlot-3.png differ diff --git a/docs/reference/alkPlot-4.png b/docs/reference/alkPlot-4.png index ffa93a4f..086fd84f 100644 Binary files a/docs/reference/alkPlot-4.png and b/docs/reference/alkPlot-4.png differ diff --git a/docs/reference/alkPlot-5.png b/docs/reference/alkPlot-5.png index 86511766..077a10c6 100644 Binary files a/docs/reference/alkPlot-5.png and b/docs/reference/alkPlot-5.png differ diff --git a/docs/reference/alkPlot-6.png b/docs/reference/alkPlot-6.png index 6d8aa459..f77c3ec0 100644 Binary files a/docs/reference/alkPlot-6.png and b/docs/reference/alkPlot-6.png differ diff --git a/docs/reference/alkPlot-7.png b/docs/reference/alkPlot-7.png index 52d14924..c85c4cc6 100644 Binary files a/docs/reference/alkPlot-7.png and b/docs/reference/alkPlot-7.png differ diff --git a/docs/reference/alkPlot-8.png b/docs/reference/alkPlot-8.png index 1fde7556..beec4376 100644 Binary files a/docs/reference/alkPlot-8.png and b/docs/reference/alkPlot-8.png differ diff --git a/docs/reference/alkPlot-9.png b/docs/reference/alkPlot-9.png index c02df2b3..93b2d092 100644 Binary files a/docs/reference/alkPlot-9.png and b/docs/reference/alkPlot-9.png differ diff --git a/docs/reference/alkPlot.html b/docs/reference/alkPlot.html index b45bb52a..ef2ec4b2 100644 --- a/docs/reference/alkPlot.html +++ b/docs/reference/alkPlot.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,25 +128,25 @@

    Plots to visualize age-length keys.

    Various plots to visualize the proportion of fish of certain ages within length intervals in an age-length key.

    -
    alkPlot(
    -  key,
    -  type = c("barplot", "area", "lines", "splines", "bubble"),
    -  xlab = "Length",
    -  ylab = ifelse(type != "bubble", "Proportion", "Age"),
    -  xlim = NULL,
    -  ylim = NULL,
    -  showLegend = FALSE,
    -  lbl.cex = 1.25,
    -  leg.cex = 1,
    -  lwd = 2,
    -  span = 0.25,
    -  pal = paletteChoices(),
    -  grid = TRUE,
    -  col = "gray80",
    -  buf = 0.45,
    -  add = FALSE,
    -  ...
    -)
    +
    alkPlot(
    +  key,
    +  type = c("barplot", "area", "lines", "splines", "bubble"),
    +  xlab = "Length",
    +  ylab = ifelse(type != "bubble", "Proportion", "Age"),
    +  xlim = NULL,
    +  ylim = NULL,
    +  showLegend = FALSE,
    +  lbl.cex = 1.25,
    +  leg.cex = 1,
    +  lwd = 2,
    +  span = 0.25,
    +  pal = paletteChoices(),
    +  grid = TRUE,
    +  col = "gray80",
    +  buf = 0.45,
    +  add = FALSE,
    +  ...
    +)

    Arguments

    @@ -230,17 +230,21 @@

    <

    5-Age-Length Key.

    References

    -

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

    +

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

    See also

    See alkIndivAge for using an age-length key to assign ages to individual fish.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Make an example age-length key -WR.age <- subset(WR79, !is.na(age)) -WR.age$LCat <- lencat(WR.age$len,w=5) -raw <- xtabs(~LCat+age,data=WR.age) -( WR.key <- prop.table(raw, margin=1) )
    #> age +WR.age <- subset(WR79, !is.na(age)) +WR.age$LCat <- lencat(WR.age$len,w=5) +raw <- xtabs(~LCat+age,data=WR.age) +( WR.key <- prop.table(raw, margin=1) ) +
    #> age #> LCat 4 5 6 7 8 9 #> 35 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 #> 40 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 @@ -279,7 +283,23 @@

    Examp #> 110 0.20000000 0.20000000 #> 115 1.00000000 0.00000000

    ## Various visualizations of the age-length key -alkPlot(WR.key,"barplot")
    alkPlot(WR.key,"barplot",pal="gray")
    alkPlot(WR.key,"barplot",showLegend=TRUE)
    alkPlot(WR.key,"area")
    alkPlot(WR.key,"area",showLegend=TRUE)
    alkPlot(WR.key,"area",pal="gray")
    alkPlot(WR.key,"lines")
    alkPlot(WR.key,"lines",pal="gray")
    alkPlot(WR.key,"lines",showLegend=TRUE)
    alkPlot(WR.key,"splines")
    alkPlot(WR.key,"splines",span=0.2)
    alkPlot(WR.key,"splines",pal="gray",showLegend=TRUE)
    alkPlot(WR.key,"bubble")
    alkPlot(WR.key,"bubble",grid=FALSE)
    alkPlot(WR.key,"bubble",grid="blue")
    alkPlot(WR.key,"bubble",grid=rgb(0,0,0,0.2),col=rgb(0,0,0,0.5))
    +alkPlot(WR.key,"barplot") +
    alkPlot(WR.key,"barplot",pal="gray") +
    alkPlot(WR.key,"barplot",showLegend=TRUE) +
    alkPlot(WR.key,"area") +
    alkPlot(WR.key,"area",showLegend=TRUE) +
    alkPlot(WR.key,"area",pal="gray") +
    alkPlot(WR.key,"lines") +
    alkPlot(WR.key,"lines",pal="gray") +
    alkPlot(WR.key,"lines",showLegend=TRUE) +
    alkPlot(WR.key,"splines") +
    alkPlot(WR.key,"splines",span=0.2) +
    alkPlot(WR.key,"splines",pal="gray",showLegend=TRUE) +
    alkPlot(WR.key,"bubble") +
    alkPlot(WR.key,"bubble",grid=FALSE) +
    alkPlot(WR.key,"bubble",grid="blue") +
    alkPlot(WR.key,"bubble",grid=rgb(0,0,0,0.2),col=rgb(0,0,0,0.5)) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/binCI.html b/docs/reference/binCI.html index f56e60f7..e1c1ddf7 100644 --- a/docs/reference/binCI.html +++ b/docs/reference/binCI.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,13 +128,13 @@

    Confidence intervals for binomial probability of success.

    Uses one of three methods to compute a confidence interval for the probability of success (p) in a binomial distribution.

    -
    binCI(
    -  x,
    -  n,
    -  conf.level = 0.95,
    -  type = c("wilson", "exact", "asymptotic"),
    -  verbose = FALSE
    -)
    +
    binCI(
    +  x,
    +  n,
    +  conf.level = 0.95,
    +  type = c("wilson", "exact", "asymptotic"),
    +  verbose = FALSE
    +)

    Arguments

    @@ -181,29 +181,41 @@

    R

    See also

    See binom.test; binconf in Hmisc; and functions in binom.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com, though this is largely based on binom.exact, binom.wilson, and binom.approx from the old epitools package.

    Examples

    ## All types at once -binCI(7,20)
    #> 95% LCI 95% UCI +binCI(7,20) +
    #> 95% LCI 95% UCI #> Exact 0.1539092 0.5921885 #> Wilson 0.1811918 0.5671457 #> Asymptotic 0.1409627 0.5590373
    ## Individual types -binCI(7,20,type="wilson")
    #> 95% LCI 95% UCI -#> 0.1811918 0.5671457
    binCI(7,20,type="exact")
    #> 95% LCI 95% UCI -#> 0.1539092 0.5921885
    binCI(7,20,type="asymptotic")
    #> 95% LCI 95% UCI -#> 0.1409627 0.5590373
    binCI(7,20,type="asymptotic",verbose=TRUE)
    #> x n proportion 95% LCI 95% UCI +binCI(7,20,type="wilson") +
    #> 95% LCI 95% UCI +#> 0.1811918 0.5671457
    binCI(7,20,type="exact") +
    #> 95% LCI 95% UCI +#> 0.1539092 0.5921885
    binCI(7,20,type="asymptotic") +
    #> 95% LCI 95% UCI +#> 0.1409627 0.5590373
    binCI(7,20,type="asymptotic",verbose=TRUE) +
    #> x n proportion 95% LCI 95% UCI #> Asymptotic 7 20 0.35 0.1409627 0.5590373
    ## Multiple types -binCI(7,20,type=c("exact","asymptotic"))
    #> 95% LCI 95% UCI +binCI(7,20,type=c("exact","asymptotic")) +
    #> 95% LCI 95% UCI #> Exact 0.1539092 0.5921885 -#> Asymptotic 0.1409627 0.5590373
    binCI(7,20,type=c("exact","asymptotic"),verbose=TRUE)
    #> x n proportion 95% LCI 95% UCI +#> Asymptotic 0.1409627 0.5590373
    binCI(7,20,type=c("exact","asymptotic"),verbose=TRUE) +
    #> x n proportion 95% LCI 95% UCI #> Exact 7 20 0.35 0.1539092 0.5921885 #> Asymptotic 7 20 0.35 0.1409627 0.5590373
    ## Use with multiple inputs -binCI(c(7,10),c(20,30),type="wilson")
    #> 95% LCI 95% UCI +binCI(c(7,10),c(20,30),type="wilson") +
    #> 95% LCI 95% UCI #> 0.1811918 0.5671457 -#> 0.1923050 0.5121995
    binCI(c(7,10),c(20,30),type="wilson",verbose=TRUE)
    #> x n proportion 95% LCI 95% UCI +#> 0.1923050 0.5121995
    binCI(c(7,10),c(20,30),type="wilson",verbose=TRUE) +
    #> x n proportion 95% LCI 95% UCI #> [1,] 7 20 0.3500000 0.1811918 0.5671457 #> [2,] 10 30 0.3333333 0.1923050 0.5121995
    @@ -222,7 +234,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/bootCase.html b/docs/reference/bootCase.html index 28583fff..8e00a392 100644 --- a/docs/reference/bootCase.html +++ b/docs/reference/bootCase.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,47 +128,47 @@

    Case bootstrapping and associated S3 methods.

    The bootCase function was added to FSA to maintain backward compatability (because bootCase was removed from car), mostly for users of the Introductory Fisheries Analyses with R book. bootCase is largerly a wrapper to Boot from car with method="case". It is suggested that Boot from car be used instead. S3 methods are also provided to construct non-parametric bootstrap confidence intervals, predictions with non-parametric confidence intervals, hypothesis tests, and plots of the parameter estimates for bootCase objects.

    -
    bootCase(object, f. = stats::coef, B = R, R = 999)
    +    
    bootCase(object, f. = stats::coef, B = R, R = 999)
     
     # S3 method for bootCase
    -confint(
    -  object,
    -  parm = NULL,
    -  level = conf.level,
    -  conf.level = 0.95,
    -  plot = FALSE,
    -  err.col = "black",
    -  err.lwd = 2,
    -  rows = NULL,
    -  cols = NULL,
    -  ...
    -)
    +confint(
    +  object,
    +  parm = NULL,
    +  level = conf.level,
    +  conf.level = 0.95,
    +  plot = FALSE,
    +  err.col = "black",
    +  err.lwd = 2,
    +  rows = NULL,
    +  cols = NULL,
    +  ...
    +)
     
     # S3 method for bootCase
    -predict(object, FUN, conf.level = 0.95, digits = NULL, ...)
    +predict(object, FUN, conf.level = 0.95, digits = NULL, ...)
     
     # S3 method for bootCase
    -htest(
    -  object,
    -  parm = NULL,
    -  bo = 0,
    -  alt = c("two.sided", "less", "greater"),
    -  plot = FALSE,
    -  ...
    -)
    +htest(
    +  object,
    +  parm = NULL,
    +  bo = 0,
    +  alt = c("two.sided", "less", "greater"),
    +  plot = FALSE,
    +  ...
    +)
     
     # S3 method for bootCase
    -hist(
    -  x,
    -  same.ylim = TRUE,
    -  ymax = NULL,
    -  rows = round(sqrt(ncol(x))),
    -  cols = ceiling(sqrt(ncol(x))),
    -  ...
    -)
    +hist(
    +  x,
    +  same.ylim = TRUE,
    +  ymax = NULL,
    +  rows = round(sqrt(ncol(x))),
    +  cols = ceiling(sqrt(ncol(x))),
    +  ...
    +)
     
     # S3 method for bootCase
    -plot(x, ...)
    +plot(x, ...)

    Arguments

    @@ -269,20 +269,34 @@

    R

    See also

    Boot in car.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    fnx <- function(days,B1,B2,B3) { - if (length(B1) > 1) { - B2 <- B1[2] - B3 <- B1[3] - B1 <- B1[1] - } - B1/(1+exp(B2+B3*days)) -} -nl1 <- nls(cells~fnx(days,B1,B2,B3),data=Ecoli, - start=list(B1=6,B2=7.2,B3=-1.45)) -nl1.bootc <- bootCase(nl1,coef,B=99) # B=99 too few to be useful
    #> 'bootCase' is provided here only for backward compatibility. -#> Consider using 'Boot' from the 'car' package instead.
    #> Error in fnx(days, B1, B2, B3): could not find function "fnx"
    confint(nl1.bootc,"B1")
    #> Error in confint(nl1.bootc, "B1"): object 'nl1.bootc' not found
    confint(nl1.bootc,c(2,3))
    #> Error in confint(nl1.bootc, c(2, 3)): object 'nl1.bootc' not found
    confint(nl1.bootc,conf.level=0.90)
    #> Error in confint(nl1.bootc, conf.level = 0.9): object 'nl1.bootc' not found
    confint(nl1.bootc,plot=TRUE)
    #> Error in confint(nl1.bootc, plot = TRUE): object 'nl1.bootc' not found
    predict(nl1.bootc,fnx,days=1:3)
    #> Error in predict(nl1.bootc, fnx, days = 1:3): object 'nl1.bootc' not found
    predict(nl1.bootc,fnx,days=3)
    #> Error in predict(nl1.bootc, fnx, days = 3): object 'nl1.bootc' not found
    htest(nl1.bootc,1,bo=6,alt="less")
    #> Error in htest(nl1.bootc, 1, bo = 6, alt = "less"): object 'nl1.bootc' not found
    hist(nl1.bootc)
    #> Error in hist(nl1.bootc): object 'nl1.bootc' not found
    plot(nl1.bootc)
    #> Error in plot(nl1.bootc): object 'nl1.bootc' not found
    cor(nl1.bootc)
    #> Error in is.data.frame(x): object 'nl1.bootc' not found
    +
    fnx <- function(days,B1,B2,B3) { + if (length(B1) > 1) { + B2 <- B1[2] + B3 <- B1[3] + B1 <- B1[1] + } + B1/(1+exp(B2+B3*days)) +} +nl1 <- nls(cells~fnx(days,B1,B2,B3),data=Ecoli, + start=list(B1=6,B2=7.2,B3=-1.45)) +nl1.bootc <- bootCase(nl1,coef,B=99) # B=99 too few to be useful +
    #> 'bootCase' is provided here only for backward compatibility. +#> Consider using 'Boot' from the 'car' package instead.
    #> Loading required namespace: boot
    #> Error in fnx(days, B1, B2, B3): could not find function "fnx"
    confint(nl1.bootc,"B1") +
    #> Error in confint(nl1.bootc, "B1"): object 'nl1.bootc' not found
    confint(nl1.bootc,c(2,3)) +
    #> Error in confint(nl1.bootc, c(2, 3)): object 'nl1.bootc' not found
    confint(nl1.bootc,conf.level=0.90) +
    #> Error in confint(nl1.bootc, conf.level = 0.9): object 'nl1.bootc' not found
    confint(nl1.bootc,plot=TRUE) +
    #> Error in confint(nl1.bootc, plot = TRUE): object 'nl1.bootc' not found
    predict(nl1.bootc,fnx,days=1:3) +
    #> Error in predict(nl1.bootc, fnx, days = 1:3): object 'nl1.bootc' not found
    predict(nl1.bootc,fnx,days=3) +
    #> Error in predict(nl1.bootc, fnx, days = 3): object 'nl1.bootc' not found
    htest(nl1.bootc,1,bo=6,alt="less") +
    #> Error in htest(nl1.bootc, 1, bo = 6, alt = "less"): object 'nl1.bootc' not found
    hist(nl1.bootc) +
    #> Error in hist(nl1.bootc): object 'nl1.bootc' not found
    plot(nl1.bootc) +
    #> Error in plot(nl1.bootc): object 'nl1.bootc' not found
    cor(nl1.bootc) +
    #> Error in is.data.frame(x): object 'nl1.bootc' not found
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/capHistConvert.html b/docs/reference/capHistConvert.html index 9a6dd218..9756b97c 100644 --- a/docs/reference/capHistConvert.html +++ b/docs/reference/capHistConvert.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,19 +128,19 @@

    Convert between capture history data.frame formats.

    Use to convert between simple versions of several capture history data.frame formats -- “individual”, “frequency”, “event”, “MARK”, and “RMark”. The primary use is to convert to the “individual” format for use in capHistSum.

    -
    capHistConvert(
    -  df,
    -  cols2use = NULL,
    -  cols2ignore = NULL,
    -  in.type = c("frequency", "event", "individual", "MARK", "marked", "RMark"),
    -  out.type = c("individual", "event", "frequency", "MARK", "marked", "RMark"),
    -  id = NULL,
    -  event.ord = NULL,
    -  freq = NULL,
    -  var.lbls = NULL,
    -  var.lbls.pre = "event",
    -  include.id = ifelse(is.null(id), FALSE, TRUE)
    -)
    +
    capHistConvert(
    +  df,
    +  cols2use = NULL,
    +  cols2ignore = NULL,
    +  in.type = c("frequency", "event", "individual", "MARK", "marked", "RMark"),
    +  out.type = c("individual", "event", "frequency", "MARK", "marked", "RMark"),
    +  id = NULL,
    +  event.ord = NULL,
    +  freq = NULL,
    +  var.lbls = NULL,
    +  var.lbls.pre = "event",
    +  include.id = ifelse(is.null(id), FALSE, TRUE)
    +)

    Arguments

    @@ -275,14 +275,18 @@

    <

    9-Abundance from Capture-Recapture Data.

    References

    -

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

    +

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

    See also

    -

    See capHistSum to summarize “individual” capture histories into a format usable in mrClosed and mrOpen. Also see Rcapture, RMark, or marked packages for handling more complex analyses.

    +

    See capHistSum to summarize “individual” capture histories into a format usable in mrClosed and mrOpen. Also see Rcapture, RMark, or marked packages for handling more complex analyses.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## A small example of 'event' format -( ex1 <- data.frame(fish=c(17,18,21,17,21,18,19,20),yr=c(1987,1987,1987,1988,1988,1989,1989,1990)) )
    #> fish yr +( ex1 <- data.frame(fish=c(17,18,21,17,21,18,19,20),yr=c(1987,1987,1987,1988,1988,1989,1989,1990)) ) +
    #> fish yr #> 1 17 1987 #> 2 18 1987 #> 3 21 1987 @@ -291,23 +295,27 @@

    Examp #> 6 18 1989 #> 7 19 1989 #> 8 20 1990

    # convert to 'individual' format -( ex1.E2I <- capHistConvert(ex1,id="fish",in.type="event") )
    #> fish 1987 1988 1989 1990 +( ex1.E2I <- capHistConvert(ex1,id="fish",in.type="event") ) +
    #> fish 1987 1988 1989 1990 #> 1 17 1 1 0 0 #> 2 18 1 0 1 0 #> 3 19 0 0 1 0 #> 4 20 0 0 0 1 #> 5 21 1 1 0 0
    # convert to 'frequency' format -( ex1.E2F <- capHistConvert(ex1,id="fish",in.type="event",out.type="frequency") )
    #> 1987 1988 1989 1990 freq +( ex1.E2F <- capHistConvert(ex1,id="fish",in.type="event",out.type="frequency") ) +
    #> 1987 1988 1989 1990 freq #> 1 0 0 0 1 1 #> 2 0 0 1 0 1 #> 3 1 0 1 0 1 #> 4 1 1 0 0 2
    # convert to 'MARK' format -( ex1.E2M <- capHistConvert(ex1,id="fish",in.type="event",out.type="MARK") )
    #> ch freq +( ex1.E2M <- capHistConvert(ex1,id="fish",in.type="event",out.type="MARK") ) +
    #> ch freq #> 1 0001 1; #> 2 0010 1; #> 3 1010 1; #> 4 1100 2;
    # convert to 'RMark' format -( ex1.E2R <- capHistConvert(ex1,id="fish",in.type="event",out.type="RMark") )
    #> fish ch +( ex1.E2R <- capHistConvert(ex1,id="fish",in.type="event",out.type="RMark") ) +
    #> fish ch #> 1 17 1100 #> 2 18 1010 #> 3 19 0010 @@ -315,23 +323,27 @@

    Examp #> 5 21 1100

    ## convert converted 'individual' format ... # to 'frequency' format (must ignore "id") -( ex1.I2F <- capHistConvert(ex1.E2I,id="fish",in.type="individual",out.type="frequency") )
    #> 1987 1988 1989 1990 freq +( ex1.I2F <- capHistConvert(ex1.E2I,id="fish",in.type="individual",out.type="frequency") ) +
    #> 1987 1988 1989 1990 freq #> 1 0 0 0 1 1 #> 2 0 0 1 0 1 #> 3 1 0 1 0 1 #> 4 1 1 0 0 2
    # to 'MARK' format -( ex1.I2M <- capHistConvert(ex1.E2I,id="fish",in.type="individual",out.type="MARK") )
    #> ch freq +( ex1.I2M <- capHistConvert(ex1.E2I,id="fish",in.type="individual",out.type="MARK") ) +
    #> ch freq #> 1 0001 1; #> 2 0010 1; #> 3 1010 1; #> 4 1100 2;
    # to 'RMark' format -( ex1.I2R <- capHistConvert(ex1.E2I,id="fish",in.type="individual",out.type="RMark") )
    #> fish ch +( ex1.I2R <- capHistConvert(ex1.E2I,id="fish",in.type="individual",out.type="RMark") ) +
    #> fish ch #> 1 17 1100 #> 2 18 1010 #> 3 19 0010 #> 4 20 0001 #> 5 21 1100
    # to 'event' format -( ex1.I2E <- capHistConvert(ex1.E2I,id="fish",in.type="individual",out.type="event") )
    #> fish event +( ex1.I2E <- capHistConvert(ex1.E2I,id="fish",in.type="individual",out.type="event") ) +
    #> fish event #> 1 17 1987 #> 2 18 1987 #> 3 21 1987 @@ -342,38 +354,44 @@

    Examp #> 8 20 1990

    #' ## convert converted 'frequency' format ... # to 'individual' format -( ex1.F2I <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency") )
    #> 1987 1988 1989 1990 +( ex1.F2I <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency") ) +
    #> 1987 1988 1989 1990 #> 1 0 0 0 1 #> 2 0 0 1 0 #> 3 1 0 1 0 #> 4 1 1 0 0 -#> 5 1 1 0 0
    ( ex1.F2Ia <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency",include.id=TRUE) )
    #> id 1987 1988 1989 1990 +#> 5 1 1 0 0
    ( ex1.F2Ia <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency",include.id=TRUE) ) +
    #> id 1987 1988 1989 1990 #> 1 1 0 0 0 1 #> 2 2 0 0 1 0 #> 3 3 1 0 1 0 #> 4 4 1 1 0 0 #> 5 5 1 1 0 0
    # to 'Mark' format -( ex1.F2M <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency", - out.type="MARK") )
    #> ch freq +( ex1.F2M <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency", + out.type="MARK") ) +
    #> ch freq #> 1 0001 1; #> 2 0010 1; #> 3 1010 1; #> 4 1100 2;
    # to 'RMark' format -( ex1.F2R <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency", - out.type="RMark") )
    #> ch +( ex1.F2R <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency", + out.type="RMark") ) +
    #> ch #> 1 0001 #> 2 0010 #> 3 1010 #> 4 1100 -#> 5 1100
    ( ex1.F2Ra <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency", - out.type="RMark",include.id=TRUE) )
    #> id ch +#> 5 1100
    ( ex1.F2Ra <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency", + out.type="RMark",include.id=TRUE) ) +
    #> id ch #> 1 1 0001 #> 2 2 0010 #> 3 3 1010 #> 4 4 1100 #> 5 5 1100
    # to 'event' format -( ex1.F2E <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency", - out.type="event") )
    #> id event +( ex1.F2E <- capHistConvert(ex1.E2F,freq="freq",in.type="frequency", + out.type="event") ) +
    #> id event #> 1 3 1987 #> 2 4 1987 #> 3 5 1987 @@ -384,34 +402,40 @@

    Examp #> 8 1 1990

    ## convert converted 'MARK' format ... # to 'individual' format -( ex1.M2I <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK") )
    #> event1 event2 event3 event4 +( ex1.M2I <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK") ) +
    #> event1 event2 event3 event4 #> 1 0 0 0 1 #> 2 0 0 1 0 #> 3 1 0 1 0 #> 4 1 1 0 0 -#> 5 1 1 0 0
    ( ex1.M2Ia <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK",include.id=TRUE) )
    #> id event1 event2 event3 event4 +#> 5 1 1 0 0
    ( ex1.M2Ia <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK",include.id=TRUE) ) +
    #> id event1 event2 event3 event4 #> 1 1 0 0 0 1 #> 2 2 0 0 1 0 #> 3 3 1 0 1 0 #> 4 4 1 1 0 0 #> 5 5 1 1 0 0
    # to 'frequency' format -( ex1.M2F <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK",out.type="frequency") )
    #> event1 event2 event3 event4 freq +( ex1.M2F <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK",out.type="frequency") ) +
    #> event1 event2 event3 event4 freq #> 1 0 0 0 1 1 #> 2 0 0 1 0 1 #> 3 1 0 1 0 1 #> 4 1 1 0 0 2
    # to 'RMark' format -( ex1.M2R <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK",out.type="RMark") )
    #> ch +( ex1.M2R <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK",out.type="RMark") ) +
    #> ch #> 1 0001 #> 2 0010 #> 3 1010 #> 4 1100 -#> 5 1100
    ( ex1.M2Ra <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK",out.type="RMark",include.id=TRUE) )
    #> id ch +#> 5 1100
    ( ex1.M2Ra <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK",out.type="RMark",include.id=TRUE) ) +
    #> id ch #> 1 1 0001 #> 2 2 0010 #> 3 3 1010 #> 4 4 1100 #> 5 5 1100
    # to 'event' format -( ex1.M2E <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK",out.type="event") )
    #> id event +( ex1.M2E <- capHistConvert(ex1.E2M,freq="freq",in.type="MARK",out.type="event") ) +
    #> id event #> 1 3 event1 #> 2 4 event1 #> 3 5 event1 @@ -419,26 +443,30 @@

    Examp #> 5 5 event2 #> 6 2 event3 #> 7 3 event3 -#> 8 1 event4

    +#> 8 1 event4
    ## convert converted 'RMark' format ... # to 'individual' format -( ex1.R2I <- capHistConvert(ex1.E2R,id="fish",in.type="RMark") )
    #> fish event1 event2 event3 event4 +( ex1.R2I <- capHistConvert(ex1.E2R,id="fish",in.type="RMark") ) +
    #> fish event1 event2 event3 event4 #> 1 17 1 1 0 0 #> 2 18 1 0 1 0 #> 3 19 0 0 1 0 #> 4 20 0 0 0 1 #> 5 21 1 1 0 0
    # to 'frequency' format -( ex1.R2F <- capHistConvert(ex1.E2R,id="fish",in.type="RMark",out.type="frequency") )
    #> event1 event2 event3 event4 freq +( ex1.R2F <- capHistConvert(ex1.E2R,id="fish",in.type="RMark",out.type="frequency") ) +
    #> event1 event2 event3 event4 freq #> 1 0 0 0 1 1 #> 2 0 0 1 0 1 #> 3 1 0 1 0 1 #> 4 1 1 0 0 2
    # to 'MARK' format -( ex1.R2M <- capHistConvert(ex1.E2R,id="fish",in.type="RMark",out.type="MARK") )
    #> ch freq +( ex1.R2M <- capHistConvert(ex1.E2R,id="fish",in.type="RMark",out.type="MARK") ) +
    #> ch freq #> 1 0001 1; #> 2 0010 1; #> 3 1010 1; #> 4 1100 2;
    # to 'event' format -( ex1.R2E <- capHistConvert(ex1.E2R,id="fish",in.type="RMark",out.type="event") )
    #> fish event +( ex1.R2E <- capHistConvert(ex1.E2R,id="fish",in.type="RMark",out.type="event") ) +
    #> fish event #> 1 17 event1 #> 2 18 event1 #> 3 21 event1 @@ -448,35 +476,41 @@

    Examp #> 7 19 event3 #> 8 20 event4

    ## Remove semi-colon from MARK format to make a RMark 'frequency' format -ex1.E2R1 <- ex1.E2M -ex1.E2R1$freq <- as.numeric(sub(";","",ex1.E2R1$freq)) -ex1.E2R1
    #> ch freq +ex1.E2R1 <- ex1.E2M +ex1.E2R1$freq <- as.numeric(sub(";","",ex1.E2R1$freq)) +ex1.E2R1 +
    #> ch freq #> 1 0001 1 #> 2 0010 1 #> 3 1010 1 #> 4 1100 2
    # convert this to 'individual' format -( ex1.R2I1 <- capHistConvert(ex1.E2R1,freq="freq",in.type="RMark") )
    #> event1 event2 event3 event4 +( ex1.R2I1 <- capHistConvert(ex1.E2R1,freq="freq",in.type="RMark") ) +
    #> event1 event2 event3 event4 #> 1 0 0 0 1 #> 2 0 0 1 0 #> 3 1 0 1 0 #> 4 1 1 0 0 -#> 5 1 1 0 0
    ( ex1.R2I1a <- capHistConvert(ex1.E2R1,freq="freq",in.type="RMark",include.id=TRUE) )
    #> id event1 event2 event3 event4 +#> 5 1 1 0 0
    ( ex1.R2I1a <- capHistConvert(ex1.E2R1,freq="freq",in.type="RMark",include.id=TRUE) ) +
    #> id event1 event2 event3 event4 #> 1 1 0 0 0 1 #> 2 2 0 0 1 0 #> 3 3 1 0 1 0 #> 4 4 1 1 0 0 #> 5 5 1 1 0 0
    # convert this to 'frequency' format -( ex1.R2F1 <- capHistConvert(ex1.E2R1,freq="freq",in.type="RMark",out.type="frequency") )
    #> event1 event2 event3 event4 freq +( ex1.R2F1 <- capHistConvert(ex1.E2R1,freq="freq",in.type="RMark",out.type="frequency") ) +
    #> event1 event2 event3 event4 freq #> 1 0 0 0 1 1 #> 2 0 0 1 0 1 #> 3 1 0 1 0 1 #> 4 1 1 0 0 2
    # convert this to 'MARK' format -( ex1.R2M1 <- capHistConvert(ex1.E2R1,freq="freq",in.type="RMark",out.type="MARK") )
    #> ch freq +( ex1.R2M1 <- capHistConvert(ex1.E2R1,freq="freq",in.type="RMark",out.type="MARK") ) +
    #> ch freq #> 1 0001 1; #> 2 0010 1; #> 3 1010 1; #> 4 1100 2;
    # convert this to 'event' format -( ex1.R2E1 <- capHistConvert(ex1.E2R1,freq="freq",in.type="RMark",out.type="event") )
    #> id event +( ex1.R2E1 <- capHistConvert(ex1.E2R1,freq="freq",in.type="RMark",out.type="event") ) +
    #> id event #> 1 3 event1 #> 2 4 event1 #> 3 5 event1 @@ -488,8 +522,9 @@

    Examp ######################################################################## ## A small example using character ids -( ex2 <- data.frame(fish=c("id17","id18","id21","id17","id21","id18","id19","id20"), - yr=c(1987,1987,1987,1988,1988,1989,1989,1990)) )

    #> fish yr +( ex2 <- data.frame(fish=c("id17","id18","id21","id17","id21","id18","id19","id20"), + yr=c(1987,1987,1987,1988,1988,1989,1989,1990)) ) +
    #> fish yr #> 1 id17 1987 #> 2 id18 1987 #> 3 id21 1987 @@ -498,23 +533,27 @@

    Examp #> 6 id18 1989 #> 7 id19 1989 #> 8 id20 1990

    # convert to 'individual' format -( ex2.E2I <- capHistConvert(ex2,id="fish",in.type="event") )
    #> fish 1987 1988 1989 1990 +( ex2.E2I <- capHistConvert(ex2,id="fish",in.type="event") ) +
    #> fish 1987 1988 1989 1990 #> 1 id17 1 1 0 0 #> 2 id18 1 0 1 0 #> 3 id19 0 0 1 0 #> 4 id20 0 0 0 1 #> 5 id21 1 1 0 0
    # convert to 'frequency' format -( ex2.E2F <- capHistConvert(ex2,id="fish",in.type="event",out.type="frequency") )
    #> 1987 1988 1989 1990 freq +( ex2.E2F <- capHistConvert(ex2,id="fish",in.type="event",out.type="frequency") ) +
    #> 1987 1988 1989 1990 freq #> 1 0 0 0 1 1 #> 2 0 0 1 0 1 #> 3 1 0 1 0 1 #> 4 1 1 0 0 2
    # convert to 'MARK' format -( ex2.E2M <- capHistConvert(ex2,id="fish",in.type="event",out.type="MARK") )
    #> ch freq +( ex2.E2M <- capHistConvert(ex2,id="fish",in.type="event",out.type="MARK") ) +
    #> ch freq #> 1 0001 1; #> 2 0010 1; #> 3 1010 1; #> 4 1100 2;
    # convert to 'RMark' format -( ex2.E2R <- capHistConvert(ex2,id="fish",in.type="event",out.type="RMark") )
    #> fish ch +( ex2.E2R <- capHistConvert(ex2,id="fish",in.type="event",out.type="RMark") ) +
    #> fish ch #> 1 id17 1100 #> 2 id18 1010 #> 3 id19 0010 @@ -522,23 +561,27 @@

    Examp #> 5 id21 1100

    ## convert converted 'individual' format ... # to 'frequency' format -( ex2.I2F <- capHistConvert(ex2.E2I,id="fish",in.type="individual",out.type="frequency") )
    #> 1987 1988 1989 1990 freq +( ex2.I2F <- capHistConvert(ex2.E2I,id="fish",in.type="individual",out.type="frequency") ) +
    #> 1987 1988 1989 1990 freq #> 1 0 0 0 1 1 #> 2 0 0 1 0 1 #> 3 1 0 1 0 1 #> 4 1 1 0 0 2
    # to 'MARK' format -( ex2.I2M <- capHistConvert(ex2.E2I,id="fish",in.type="individual",out.type="MARK") )
    #> ch freq +( ex2.I2M <- capHistConvert(ex2.E2I,id="fish",in.type="individual",out.type="MARK") ) +
    #> ch freq #> 1 0001 1; #> 2 0010 1; #> 3 1010 1; #> 4 1100 2;
    # to 'RMark' format -( ex2.I2R <- capHistConvert(ex2.E2I,id="fish",in.type="individual",out.type="RMark") )
    #> fish ch +( ex2.I2R <- capHistConvert(ex2.E2I,id="fish",in.type="individual",out.type="RMark") ) +
    #> fish ch #> 1 id17 1100 #> 2 id18 1010 #> 3 id19 0010 #> 4 id20 0001 #> 5 id21 1100
    # to 'event' format -( ex2.I2E <- capHistConvert(ex2.E2I,id="fish",in.type="individual",out.type="event") )
    #> fish event +( ex2.I2E <- capHistConvert(ex2.E2I,id="fish",in.type="individual",out.type="event") ) +
    #> fish event #> 1 id17 1987 #> 2 id18 1987 #> 3 id21 1987 @@ -548,20 +591,23 @@

    Examp #> 7 id19 1989 #> 8 id20 1990

    ## demo use of var.lbls -( ex2.E2Ia <- capHistConvert(ex2,id="fish",in.type="event",var.lbls.pre="Sample") )
    #> fish 1987 1988 1989 1990 +( ex2.E2Ia <- capHistConvert(ex2,id="fish",in.type="event",var.lbls.pre="Sample") ) +
    #> fish 1987 1988 1989 1990 #> 1 id17 1 1 0 0 #> 2 id18 1 0 1 0 #> 3 id19 0 0 1 0 #> 4 id20 0 0 0 1 -#> 5 id21 1 1 0 0
    ( ex2.E2Ib <- capHistConvert(ex2,id="fish",in.type="event", - var.lbls=c("first","second","third","fourth")) )
    #> fish first second third fourth +#> 5 id21 1 1 0 0
    ( ex2.E2Ib <- capHistConvert(ex2,id="fish",in.type="event", + var.lbls=c("first","second","third","fourth")) ) +
    #> fish first second third fourth #> 1 id17 1 1 0 0 #> 2 id18 1 0 1 0 #> 3 id19 0 0 1 0 #> 4 id20 0 0 0 1 #> 5 id21 1 1 0 0
    ## demo use of event.ord -( ex2.I2Ea <- capHistConvert(ex2.E2Ib,id="fish",in.type="individual",out.type="event") )
    #> fish event +( ex2.I2Ea <- capHistConvert(ex2.E2Ib,id="fish",in.type="individual",out.type="event") ) +
    #> fish event #> 1 id17 first #> 2 id18 first #> 3 id21 first @@ -569,69 +615,72 @@

    Examp #> 5 id21 second #> 6 id18 third #> 7 id19 third -#> 8 id20 fourth

    ( ex2.E2Ibad <- capHistConvert(ex2.I2Ea,id="fish",in.type="event") )
    #> fish first fourth second third +#> 8 id20 fourth
    ( ex2.E2Ibad <- capHistConvert(ex2.I2Ea,id="fish",in.type="event") ) +
    #> fish first fourth second third #> 1 id17 1 0 1 0 #> 2 id18 1 0 0 1 #> 3 id19 0 0 0 1 #> 4 id20 0 1 0 0 -#> 5 id21 1 0 1 0
    ( ex2.E2Igood <- capHistConvert(ex2.I2Ea,id="fish",in.type="event", - event.ord=c("first","second","third","fourth")) )
    #> fish first second third fourth +#> 5 id21 1 0 1 0
    ( ex2.E2Igood <- capHistConvert(ex2.I2Ea,id="fish",in.type="event", + event.ord=c("first","second","third","fourth")) ) +
    #> fish first second third fourth #> 1 id17 1 1 0 0 #> 2 id18 1 0 1 0 #> 3 id19 0 0 1 0 #> 4 id20 0 0 0 1 #> 5 id21 1 1 0 0
    ## ONLY RUN IN INTERACTIVE MODE -if (interactive()) { +if (interactive()) { ######################################################################## ## A larger example of 'frequency' format (data from Rcapture package) -data(bunting,package="Rcapture") -head(bunting) +data(bunting,package="Rcapture") +head(bunting) # convert to 'individual' format -bun.F2I <- capHistConvert(bunting,in.type="frequency",freq="freq") -head(bun.F2I) +bun.F2I <- capHistConvert(bunting,in.type="frequency",freq="freq") +head(bun.F2I) # convert to 'MARK' format -bun.F2M <- capHistConvert(bunting,id="id",in.type="frequency",freq="freq",out.type="MARK") -head(bun.F2M) +bun.F2M <- capHistConvert(bunting,id="id",in.type="frequency",freq="freq",out.type="MARK") +head(bun.F2M) # convert converted 'individual' back to 'MARK' format -bun.I2M <- capHistConvert(bun.F2I,id="id",in.type="individual",out.type="MARK") -head(bun.I2M) +bun.I2M <- capHistConvert(bun.F2I,id="id",in.type="individual",out.type="MARK") +head(bun.I2M) # convert converted 'individual' back to 'frequency' format -bun.I2F <- capHistConvert(bun.F2I,id="id",in.type="individual", - out.type="frequency",var.lbls.pre="Sample") -head(bun.I2F) +bun.I2F <- capHistConvert(bun.F2I,id="id",in.type="individual", + out.type="frequency",var.lbls.pre="Sample") +head(bun.I2F) ######################################################################## ## A larger example of 'marked' or 'RMark' format, but with a covariate ## and when the covariate is removed there is no frequency or individual ## fish identifier. -data(dipper,package="marked") -head(dipper) +data(dipper,package="marked") +head(dipper) # isolate males and females -dipperF <- subset(dipper,sex=="Female") -dipperM <- subset(dipper,sex=="Male") +dipperF <- subset(dipper,sex=="Female") +dipperM <- subset(dipper,sex=="Male") # convert females to 'individual' format -dipF.R2I <- capHistConvert(dipperF,cols2ignore="sex",in.type="RMark") -head(dipF.R2I) +dipF.R2I <- capHistConvert(dipperF,cols2ignore="sex",in.type="RMark") +head(dipF.R2I) # convert males to 'individual' format -dipM.R2I <- capHistConvert(dipperM,cols2ignore="sex",in.type="RMark") -head(dipM.R2I) +dipM.R2I <- capHistConvert(dipperM,cols2ignore="sex",in.type="RMark") +head(dipM.R2I) # add sex variable to each data.frame and then combine -dipF.R2I$sex <- "Female" -dipM.R2I$sex <- "Male" -dip.R2I <- rbind(dipF.R2I,dipM.R2I) -head(dip.R2I) -tail(dip.R2I) +dipF.R2I$sex <- "Female" +dipM.R2I$sex <- "Male" +dip.R2I <- rbind(dipF.R2I,dipM.R2I) +head(dip.R2I) +tail(dip.R2I) -} # end interactive +} # end interactive ## An example of problem with unused levels ## Create a set of test data with several groups -( df <- data.frame(fish=c("id17","id18","id21","id17","id21","id18","id19","id20","id17"), - group=c("B1","B1","B1","B2","B2","B3","B4","C1","C1")) )
    #> fish group +( df <- data.frame(fish=c("id17","id18","id21","id17","id21","id18","id19","id20","id17"), + group=c("B1","B1","B1","B2","B2","B3","B4","C1","C1")) ) +
    #> fish group #> 1 id17 B1 #> 2 id18 B1 #> 3 id21 B1 @@ -641,7 +690,8 @@

    Examp #> 7 id19 B4 #> 8 id20 C1 #> 9 id17 C1

    # Let's assume the user wants to subset the data from the "B" group -( df1 <- subset(df,group %in% c("B1","B2","B3","B4")) )
    #> fish group +( df1 <- subset(df,group %in% c("B1","B2","B3","B4")) ) +
    #> fish group #> 1 id17 B1 #> 2 id18 B1 #> 3 id21 B1 @@ -650,13 +700,15 @@

    Examp #> 6 id18 B3 #> 7 id19 B4

    # Looks like capHistConvert() is still using the unused factor # level from group C -capHistConvert(df1,id="fish",in.type="event")
    #> fish B1 B2 B3 B4 +capHistConvert(df1,id="fish",in.type="event") +
    #> fish B1 B2 B3 B4 #> 1 id17 1 1 0 0 #> 2 id18 1 0 1 0 #> 3 id19 0 0 0 1 #> 4 id21 1 1 0 0
    # use droplevels() to remove the unused groups and no problem -df1 <- droplevels(df1) -capHistConvert(df1,id="fish",in.type="event")
    #> fish B1 B2 B3 B4 +df1 <- droplevels(df1) +capHistConvert(df1,id="fish",in.type="event") +
    #> fish B1 B2 B3 B4 #> 1 id17 1 1 0 0 #> 2 id18 1 0 1 0 #> 3 id19 0 0 0 1 @@ -677,7 +729,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/capHistSum-1.png b/docs/reference/capHistSum-1.png index 0b5e7a21..86d0a9ef 100644 Binary files a/docs/reference/capHistSum-1.png and b/docs/reference/capHistSum-1.png differ diff --git a/docs/reference/capHistSum-2.png b/docs/reference/capHistSum-2.png index 963c9142..1fded423 100644 Binary files a/docs/reference/capHistSum-2.png and b/docs/reference/capHistSum-2.png differ diff --git a/docs/reference/capHistSum-3.png b/docs/reference/capHistSum-3.png index ed01ce78..eab7f3b1 100644 Binary files a/docs/reference/capHistSum-3.png and b/docs/reference/capHistSum-3.png differ diff --git a/docs/reference/capHistSum.html b/docs/reference/capHistSum.html index e2be04f0..f2745eb7 100644 --- a/docs/reference/capHistSum.html +++ b/docs/reference/capHistSum.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -125,15 +125,15 @@

    Summarize capture histories in individual fish format.

    -

    Use to summarize a capture history data file that is in the “individual” fish format (see capHistConvert for a discussion of data file format types). Summarized capture history results may be used in the Lincoln-Petersen, Schnabel, Schumacher-Eschmeyer, or Jolly-Seber methods for estimating population abundance (see mrClosed and mrOpen).

    +

    Use to summarize a capture history data file that is in the “individual” fish format (see capHistConvert for a discussion of data file format types). Summarized capture history results may be used in the Lincoln-Petersen, Schnabel, Schumacher-Eschmeyer, or Jolly-Seber methods for estimating population abundance (see mrClosed and mrOpen).

    -
    capHistSum(df, cols2use = NULL, cols2ignore = NULL)
    +    
    capHistSum(df, cols2use = NULL, cols2ignore = NULL)
     
    -is.CapHist(x)
    +is.CapHist(x)
     
     # S3 method for CapHist
    -plot(x, what = c("u", "f"), pch = 19, cex.pch = 0.7, lwd = 1, ...)
    +plot(x, what = c("u", "f"), pch = 19, cex.pch = 0.7, lwd = 1, ...)

    Arguments

    @@ -194,7 +194,7 @@

    Value

    Details

    This function requires the capture history data file to be in the “individual” fish format. See capHistConvert for a description of this (and other) formats and for methods to convert from other formats to the “individual” fish format. In addition, this function requires only the capture history portion of the data file. Thus, if df contains columns with non-capture history information (e.g., fish ID, length, location, etc.) then use cols2use= to identify which columns contain only the capture history information. Columns to use can be identified by listing the column numbers (e.g., columns 2 through 7 could be included with cols2use=2:7). In many instances it may be easier to identify columns to exclude which can be done by preceding the column number by a negative sign (e.g., columns 1 through 3 are excluded with cols2use=-(1:3)).

    -

    The object returned from this function can be used directly in mrClosed and mrOpen. See examples of this functionality on the help pages for those functions.

    +

    The object returned from this function can be used directly in mrClosed and mrOpen. See examples of this functionality on the help pages for those functions.

    The plot function can be used to construct the two diagnostic plots described by Baillargeon and Rivest (2007). The what="f" plot will plot the log of the number of fish seen i times divided by choose(t,i) against i. The what="u" plot will plot the log of the number of fish seen for the first time on event i against i. Baillargeon and Rivest (2007) provide a table that can be used to diagnosed types of heterogeneities in capture probabilities from these plots.

    Note

    @@ -204,15 +204,19 @@

    <

    9-Abundance from Capture-Recapture Data.

    References

    -

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

    +

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

    Baillargeon, S. and Rivest, L.-P. (2007). Rcapture: Loglinear models for capture-recapture in R. Journal of Statistical Software, 19(5):1-31.

    See also

    -

    See descriptive in Rcapture for m.array and some of the same values in sum. See capHistConvert for a descriptions of capture history data file formats and how to convert between them. See mrClosed and mrOpen for how to estimate abundance from the summarized capture history information.

    +

    See descriptive in Rcapture for m.array and some of the same values in sum. See capHistConvert for a descriptions of capture history data file formats and how to convert between them. See mrClosed and mrOpen for how to estimate abundance from the summarized capture history information.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    # data.frame with IDs in the first column -head(PikeNYPartial1)
    #> id first second third fourth +head(PikeNYPartial1) +
    #> id first second third fourth #> 1 2001 1 0 0 0 #> 2 2002 1 0 0 0 #> 3 2003 1 0 0 0 @@ -220,7 +224,8 @@

    Examp #> 5 2005 1 0 0 0 #> 6 2006 1 0 0 0

    # Three ways to ignore first column of ID numbers -( ch1 <- capHistSum(PikeNYPartial1,cols2use=-1) )
    #> $caphist +( ch1 <- capHistSum(PikeNYPartial1,cols2use=-1) ) +
    #> $caphist #> #> 0001 0010 0011 0100 0101 0110 1000 1001 1010 1100 #> 5 8 2 12 1 2 21 1 2 3 @@ -254,7 +259,8 @@

    Examp #> i=4 9 NA NA NA 9 #> #> attr(,"class") -#> [1] "CapHist"

    ( ch1 <- capHistSum(PikeNYPartial1,cols2ignore=1) )
    #> $caphist +#> [1] "CapHist"
    ( ch1 <- capHistSum(PikeNYPartial1,cols2ignore=1) ) +
    #> $caphist #> #> 0001 0010 0011 0100 0101 0110 1000 1001 1010 1100 #> 5 8 2 12 1 2 21 1 2 3 @@ -288,7 +294,8 @@

    Examp #> i=4 9 NA NA NA 9 #> #> attr(,"class") -#> [1] "CapHist"

    ( ch1 <- capHistSum(PikeNYPartial1,cols2ignore="id") )
    #> $caphist +#> [1] "CapHist"
    ( ch1 <- capHistSum(PikeNYPartial1,cols2ignore="id") ) +
    #> $caphist #> #> 0001 0010 0011 0100 0101 0110 1000 1001 1010 1100 #> 5 8 2 12 1 2 21 1 2 3 @@ -324,9 +331,13 @@

    Examp #> attr(,"class") #> [1] "CapHist"

    # diagnostic plots -plot(ch1)
    plot(ch1,what="f")
    plot(ch1,what="u")
    +plot(ch1) +
    plot(ch1,what="f") +
    plot(ch1,what="u") +
    # An examle with only two sample events (for demonstration only) -( ch2 <- capHistSum(PikeNYPartial1,cols2use=-c(1,4:5)) )
    #> $caphist +( ch2 <- capHistSum(PikeNYPartial1,cols2use=-c(1,4:5)) ) +
    #> $caphist #> #> 00 01 10 11 #> 15 15 24 3 @@ -336,7 +347,8 @@

    Examp #> 1 27 18 3 #> #> attr(,"class") -#> [1] "CapHist"

    ( ch2 <- capHistSum(PikeNYPartial1,cols2use=2:3) )
    #> $caphist +#> [1] "CapHist"
    ( ch2 <- capHistSum(PikeNYPartial1,cols2use=2:3) ) +
    #> $caphist #> #> 00 01 10 11 #> 15 15 24 3 @@ -346,7 +358,8 @@

    Examp #> 1 27 18 3 #> #> attr(,"class") -#> [1] "CapHist"

    ( ch2 <- capHistSum(PikeNYPartial1,cols2ignore=c(1,4:5)) )
    #> $caphist +#> [1] "CapHist"
    ( ch2 <- capHistSum(PikeNYPartial1,cols2ignore=c(1,4:5)) ) +
    #> $caphist #> #> 00 01 10 11 #> 15 15 24 3 @@ -373,7 +386,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/catchCurve-1.png b/docs/reference/catchCurve-1.png index a2341fd5..cddda73c 100644 Binary files a/docs/reference/catchCurve-1.png and b/docs/reference/catchCurve-1.png differ diff --git a/docs/reference/catchCurve-2.png b/docs/reference/catchCurve-2.png index 63c941ec..bc970769 100644 Binary files a/docs/reference/catchCurve-2.png and b/docs/reference/catchCurve-2.png differ diff --git a/docs/reference/catchCurve-3.png b/docs/reference/catchCurve-3.png index 173f8140..c5b90f25 100644 Binary files a/docs/reference/catchCurve-3.png and b/docs/reference/catchCurve-3.png differ diff --git a/docs/reference/catchCurve-4.png b/docs/reference/catchCurve-4.png index 836ddce6..c0791ad3 100644 Binary files a/docs/reference/catchCurve-4.png and b/docs/reference/catchCurve-4.png differ diff --git a/docs/reference/catchCurve-5.png b/docs/reference/catchCurve-5.png index ebc2b113..e59549a3 100644 Binary files a/docs/reference/catchCurve-5.png and b/docs/reference/catchCurve-5.png differ diff --git a/docs/reference/catchCurve.html b/docs/reference/catchCurve.html index ff709747..9871c7b5 100644 --- a/docs/reference/catchCurve.html +++ b/docs/reference/catchCurve.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,62 +128,62 @@

    Mortality estimates from the descending limb of a catch curve.

    Fits a linear model to the user-defined descending limb of a catch curve. Method functions extract estimates of the instantaneous (Z) and total annual (A) mortality rates with associated standard errors and confidence intervals. A plot method highlights the descending limb, shows the linear model on the descending limb, and, optionally, prints the estimated Z and A.

    -
    catchCurve(x, ...)
    +    
    catchCurve(x, ...)
     
     # S3 method for default
    -catchCurve(
    -  x,
    -  catch,
    -  ages2use = age,
    -  weighted = FALSE,
    -  negWeightReplace = 0,
    -  ...
    -)
    +catchCurve(
    +  x,
    +  catch,
    +  ages2use = age,
    +  weighted = FALSE,
    +  negWeightReplace = 0,
    +  ...
    +)
     
     # S3 method for formula
    -catchCurve(
    -  x,
    -  data,
    -  ages2use = age,
    -  weighted = FALSE,
    -  negWeightReplace = 0,
    -  ...
    -)
    +catchCurve(
    +  x,
    +  data,
    +  ages2use = age,
    +  weighted = FALSE,
    +  negWeightReplace = 0,
    +  ...
    +)
     
     # S3 method for catchCurve
    -summary(object, parm = c("both", "all", "Z", "A", "lm"), ...)
    +summary(object, parm = c("both", "all", "Z", "A", "lm"), ...)
     
     # S3 method for catchCurve
    -coef(object, parm = c("all", "both", "Z", "A", "lm"), ...)
    +coef(object, parm = c("all", "both", "Z", "A", "lm"), ...)
     
     # S3 method for catchCurve
    -anova(object, ...)
    +anova(object, ...)
     
     # S3 method for catchCurve
    -confint(
    -  object,
    -  parm = c("all", "both", "Z", "A", "lm"),
    -  level = conf.level,
    -  conf.level = 0.95,
    -  ...
    -)
    +confint(
    +  object,
    +  parm = c("all", "both", "Z", "A", "lm"),
    +  level = conf.level,
    +  conf.level = 0.95,
    +  ...
    +)
     
     # S3 method for catchCurve
    -rSquared(object, digits = getOption("digits"), percent = FALSE, ...)
    +rSquared(object, digits = getOption("digits"), percent = FALSE, ...)
     
     # S3 method for catchCurve
    -plot(
    -  x,
    -  pos.est = "topright",
    -  cex.est = 0.95,
    -  ylab = "log(Catch)",
    -  xlab = "Age",
    -  col.pt = "gray30",
    -  col.mdl = "black",
    -  lwd = 2,
    -  lty = 1,
    -  ...
    -)
    +plot( + x, + pos.est = "topright", + cex.est = 0.95, + ylab = "log(Catch)", + xlab = "Age", + col.pt = "gray30", + col.mdl = "black", + lwd = 2, + lty = 1, + ... +)

    Arguments

    @@ -297,36 +297,51 @@

    <

    11-Mortality.

    References

    -

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

    +

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

    Maceina, M.J., and P.W. Bettoli. 1998. Variation in Largemouth Bass recruitment in four mainstream impoundments on the Tennessee River. North American Journal of Fisheries Management 18:998-1003.

    Ricker, W.E. 1975. Computation and interpretation of biological statistics of fish populations. Technical Report Bulletin 191, Bulletin of the Fisheries Research Board of Canada. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/1485.pdf.]

    See also

    -

    See agesurv in fishmethods for similar functionality. See chapmanRobson and agesurvcl in fishmethods for alternative methods to estimate mortality rates. See metaM for empirical methods to estimate natural mortality.

    +

    See agesurv in fishmethods for similar functionality. See chapmanRobson and agesurvcl in fishmethods for alternative methods to estimate mortality rates. See metaM for empirical methods to estimate natural mortality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    plot(catch~age,data=BrookTroutTH,pch=19)
    +
    plot(catch~age,data=BrookTroutTH,pch=19) +
    ## demonstration of formula notation -cc1 <- catchCurve(catch~age,data=BrookTroutTH,ages2use=2:6) -summary(cc1)
    #> Estimate Std. Error t value Pr(>|t|) +cc1 <- catchCurve(catch~age,data=BrookTroutTH,ages2use=2:6) +summary(cc1) +
    #> Estimate Std. Error t value Pr(>|t|) #> Z 0.659987 0.136741 4.826549 0.01695159 -#> A 48.314197 NA NA NA
    cbind(Est=coef(cc1),confint(cc1))
    #> Est 95% LCI 95% UCI +#> A 48.314197 NA NA NA
    cbind(Est=coef(cc1),confint(cc1)) +
    #> Est 95% LCI 95% UCI #> Z 0.659987 0.2248162 1.095158 -#> A 48.314197 20.1337012 66.551321
    #> [1] 0.8859124
    plot(cc1)
    summary(cc1,parm="Z")
    #> Estimate Std. Error t value Pr(>|t|) -#> Z 0.659987 0.136741 4.826549 0.01695159
    cbind(Est=coef(cc1,parm="Z"),confint(cc1,parm="Z"))
    #> Est 95% LCI 95% UCI +#> A 48.314197 20.1337012 66.551321
    rSquared(cc1) +
    #> [1] 0.8859124
    plot(cc1) +
    summary(cc1,parm="Z") +
    #> Estimate Std. Error t value Pr(>|t|) +#> Z 0.659987 0.136741 4.826549 0.01695159
    cbind(Est=coef(cc1,parm="Z"),confint(cc1,parm="Z")) +
    #> Est 95% LCI 95% UCI #> Z 0.659987 0.2248162 1.095158
    ## demonstration of excluding ages2use -cc2 <- catchCurve(catch~age,data=BrookTroutTH,ages2use=-c(0,1)) -summary(cc2)
    #> Estimate Std. Error t value Pr(>|t|) +cc2 <- catchCurve(catch~age,data=BrookTroutTH,ages2use=-c(0,1)) +summary(cc2) +
    #> Estimate Std. Error t value Pr(>|t|) #> Z 0.659987 0.136741 4.826549 0.01695159 -#> A 48.314197 NA NA NA
    plot(cc2)
    +#> A 48.314197 NA NA NA
    plot(cc2) +
    ## demonstration of using weights -cc3 <- catchCurve(catch~age,data=BrookTroutTH,ages2use=2:6,weighted=TRUE) -summary(cc3)
    #> Estimate Std. Error t value Pr(>|t|) +cc3 <- catchCurve(catch~age,data=BrookTroutTH,ages2use=2:6,weighted=TRUE) +summary(cc3) +
    #> Estimate Std. Error t value Pr(>|t|) #> Z 0.6430183 0.1417433 4.5365 0.02004993 -#> A 47.4296703 NA NA NA
    plot(cc3)
    +#> A 47.4296703 NA NA NA
    plot(cc3) +
    ## demonstration of returning the linear model results -summary(cc3,parm="lm")
    #> +summary(cc3,parm="lm") +
    #> #> Call: #> stats::lm(formula = log.catch.e ~ age.e, weights = W, na.action = stats::na.exclude) #> @@ -344,23 +359,29 @@

    Examp #> Residual standard error: 0.7988 on 3 degrees of freedom #> Multiple R-squared: 0.8728, Adjusted R-squared: 0.8304 #> F-statistic: 20.58 on 1 and 3 DF, p-value: 0.02005 -#>

    cbind(Est=coef(cc3,parm="lm"),confint(cc3,parm="lm"))
    #> Est 95% LCI 95% UCI +#>
    cbind(Est=coef(cc3,parm="lm"),confint(cc3,parm="lm")) +
    #> Est 95% LCI 95% UCI #> (Intercept) 6.0085938 4.266116 7.751072 #> age.e -0.6430183 -1.094109 -0.191928
    ## demonstration of ability to work with missing age classes -df <- data.frame(age=c( 2, 3, 4, 5, 7, 9,12), - ct= c(100,92,83,71,56,35, 1)) -cc4 <- catchCurve(ct~age,data=df,ages2use=4:12)
    #> Warning: Some 'ages2use' not in observed ages.
    summary(cc4)
    #> Estimate Std. Error t value Pr(>|t|) +df <- data.frame(age=c( 2, 3, 4, 5, 7, 9,12), + ct= c(100,92,83,71,56,35, 1)) +cc4 <- catchCurve(ct~age,data=df,ages2use=4:12) +
    #> Warning: Some 'ages2use' not in observed ages.
    summary(cc4) +
    #> Estimate Std. Error t value Pr(>|t|) #> Z 0.5139824 0.1495532 3.436786 0.04133277 -#> A 40.1891060 NA NA NA
    plot(cc4)
    +#> A 40.1891060 NA NA NA
    plot(cc4) +
    ## demonstration of ability to work with missing age classes ## evein if catches are recorded as NAs -df <- data.frame(age=c( 2, 3, 4, 5, 6, 7, 8, 9,10,11,12), - ct= c(100,92,83,71,NA,56,NA,35,NA,NA, 1)) -cc5 <- catchCurve(ct~age,data=df,ages2use=4:12) -summary(cc5)
    #> Estimate Std. Error t value Pr(>|t|) +df <- data.frame(age=c( 2, 3, 4, 5, 6, 7, 8, 9,10,11,12), + ct= c(100,92,83,71,NA,56,NA,35,NA,NA, 1)) +cc5 <- catchCurve(ct~age,data=df,ages2use=4:12) +summary(cc5) +
    #> Estimate Std. Error t value Pr(>|t|) #> Z 0.5139824 0.1495532 3.436786 0.04133277 -#> A 40.1891060 NA NA NA
    plot(cc5)
    +#> A 40.1891060 NA NA NA
    plot(cc5) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/chapmanRobson-1.png b/docs/reference/chapmanRobson-1.png index a2341fd5..cddda73c 100644 Binary files a/docs/reference/chapmanRobson-1.png and b/docs/reference/chapmanRobson-1.png differ diff --git a/docs/reference/chapmanRobson-2.png b/docs/reference/chapmanRobson-2.png index eabdb3ff..fb69e3df 100644 Binary files a/docs/reference/chapmanRobson-2.png and b/docs/reference/chapmanRobson-2.png differ diff --git a/docs/reference/chapmanRobson-3.png b/docs/reference/chapmanRobson-3.png index 2737fc2f..8b0f0c49 100644 Binary files a/docs/reference/chapmanRobson-3.png and b/docs/reference/chapmanRobson-3.png differ diff --git a/docs/reference/chapmanRobson-4.png b/docs/reference/chapmanRobson-4.png index c98a56ba..7e200627 100644 Binary files a/docs/reference/chapmanRobson-4.png and b/docs/reference/chapmanRobson-4.png differ diff --git a/docs/reference/chapmanRobson-5.png b/docs/reference/chapmanRobson-5.png index eabdb3ff..fb69e3df 100644 Binary files a/docs/reference/chapmanRobson-5.png and b/docs/reference/chapmanRobson-5.png differ diff --git a/docs/reference/chapmanRobson-6.png b/docs/reference/chapmanRobson-6.png index 48acc1bd..431f6434 100644 Binary files a/docs/reference/chapmanRobson-6.png and b/docs/reference/chapmanRobson-6.png differ diff --git a/docs/reference/chapmanRobson.html b/docs/reference/chapmanRobson.html index c62ce610..582badad 100644 --- a/docs/reference/chapmanRobson.html +++ b/docs/reference/chapmanRobson.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,52 +128,52 @@

    Computes Chapman-Robson estimates of S and Z.

    Computes the Chapman-Robson estimates of annual survival rate (S) and instantaneous mortality rate (Z) from catch-at-age data on the descending limb of a catch-curve. Method functions extract estimates with associated standard errors and confidence intervals. A plot method highlights the descending-limb, shows the linear model on the descending limb, and, optionally, prints the estimated Z and A.

    -
    chapmanRobson(x, ...)
    +    
    chapmanRobson(x, ...)
     
     # S3 method for default
    -chapmanRobson(
    -  x,
    -  catch,
    -  ages2use = age,
    -  zmethod = c("Smithetal", "Hoenigetal", "original"),
    -  ...
    -)
    +chapmanRobson(
    +  x,
    +  catch,
    +  ages2use = age,
    +  zmethod = c("Smithetal", "Hoenigetal", "original"),
    +  ...
    +)
     
     # S3 method for formula
    -chapmanRobson(
    -  x,
    -  data,
    -  ages2use = age,
    -  zmethod = c("Smithetal", "Hoenigetal", "original"),
    -  ...
    -)
    +chapmanRobson(
    +  x,
    +  data,
    +  ages2use = age,
    +  zmethod = c("Smithetal", "Hoenigetal", "original"),
    +  ...
    +)
     
     # S3 method for chapmanRobson
    -summary(object, parm = c("all", "both", "Z", "S"), verbose = FALSE, ...)
    +summary(object, parm = c("all", "both", "Z", "S"), verbose = FALSE, ...)
     
     # S3 method for chapmanRobson
    -coef(object, parm = c("all", "both", "Z", "S"), ...)
    +coef(object, parm = c("all", "both", "Z", "S"), ...)
     
     # S3 method for chapmanRobson
    -confint(
    -  object,
    -  parm = c("all", "both", "S", "Z"),
    -  level = conf.level,
    -  conf.level = 0.95,
    -  ...
    -)
    +confint(
    +  object,
    +  parm = c("all", "both", "S", "Z"),
    +  level = conf.level,
    +  conf.level = 0.95,
    +  ...
    +)
     
     # S3 method for chapmanRobson
    -plot(
    -  x,
    -  pos.est = "topright",
    -  cex.est = 0.95,
    -  ylab = "Catch",
    -  xlab = "Age",
    -  col.pt = "gray30",
    -  axis.age = c("both", "age", "recoded age"),
    -  ...
    -)
    +plot( + x, + pos.est = "topright", + cex.est = 0.95, + ylab = "Catch", + xlab = "Age", + col.pt = "gray30", + axis.age = c("both", "age", "recoded age"), + ... +)

    Arguments

    @@ -274,7 +274,7 @@

    <

    11-Mortality.

    References

    -

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

    +

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

    Chapman, D.G. and D.S. Robson. 1960. The analysis of a catch curve. Biometrics. 16:354-368.

    Hoenig, J.M. and W.D. Lawing, and N.A. Hoenig. 1983. Using mean age, mean length and median length data to estimate the total mortality rate. International Council for the Exploration of the Sea, CM 1983/D:23, Copenhagen.

    Ricker, W.E. 1975. Computation and interpretation of biological statistics of fish populations. Technical Report Bulletin 191, Bulletin of the Fisheries Research Board of Canada. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/1485.pdf.]

    @@ -282,32 +282,49 @@

    R

    Smith, M.W., A.Y. Then, C. Wor, G. Ralph, K.H. Pollock, and J.M. Hoenig. 2012. Recommendations for catch-curve analysis. North American Journal of Fisheries Management. 32:956-967.

    See also

    -

    See agesurv in fishmethods for similar functionality. See catchCurve and agesurvcl in fishmethods for alternative methods. See metaM for empirical methods to estimate natural mortality.

    +

    See agesurv in fishmethods for similar functionality. See catchCurve and agesurvcl in fishmethods for alternative methods. See metaM for empirical methods to estimate natural mortality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    plot(catch~age,data=BrookTroutTH,pch=19)
    +
    plot(catch~age,data=BrookTroutTH,pch=19) +
    ## demonstration of formula notation -cr1 <- chapmanRobson(catch~age,data=BrookTroutTH,ages2use=2:6) -summary(cr1)
    #> Estimate Std. Error +cr1 <- chapmanRobson(catch~age,data=BrookTroutTH,ages2use=2:6) +summary(cr1) +
    #> Estimate Std. Error #> S 49.4600432 2.3260749 -#> Z 0.7018264 0.1153428
    summary(cr1,verbose=TRUE)
    #> Intermediate statistics: n=235; T=229
    #> Estimate Std. Error +#> Z 0.7018264 0.1153428
    summary(cr1,verbose=TRUE) +
    #> Intermediate statistics: n=235; T=229
    #> Estimate Std. Error #> S 49.4600432 2.3260749 -#> Z 0.7018264 0.1153428
    cbind(Est=coef(cr1),confint(cr1))
    #> Est 95% LCI 95% UCI +#> Z 0.7018264 0.1153428
    cbind(Est=coef(cr1),confint(cr1)) +
    #> Est 95% LCI 95% UCI #> S 49.4600432 44.9010202 54.0190662 -#> Z 0.7018264 0.4757586 0.9278941
    plot(cr1)
    plot(cr1,axis.age="age")
    plot(cr1,axis.age="recoded age")
    summary(cr1,parm="Z")
    #> Estimate Std. Error -#> Z 0.7018264 0.1153428
    cbind(Est=coef(cr1,parm="Z"),confint(cr1,parm="Z"))
    #> Est 95% LCI 95% UCI +#> Z 0.7018264 0.4757586 0.9278941
    plot(cr1) +
    plot(cr1,axis.age="age") +
    plot(cr1,axis.age="recoded age") +
    summary(cr1,parm="Z") +
    #> Estimate Std. Error +#> Z 0.7018264 0.1153428
    cbind(Est=coef(cr1,parm="Z"),confint(cr1,parm="Z")) +
    #> Est 95% LCI 95% UCI #> Z 0.7018264 0.4757586 0.9278941
    ## demonstration of excluding ages2use -cr2 <- chapmanRobson(catch~age,data=BrookTroutTH,ages2use=-c(0,1)) -summary(cr2)
    #> Estimate Std. Error +cr2 <- chapmanRobson(catch~age,data=BrookTroutTH,ages2use=-c(0,1)) +summary(cr2) +
    #> Estimate Std. Error #> S 49.4600432 2.3260749 -#> Z 0.7018264 0.1153428
    plot(cr2)
    +#> Z 0.7018264 0.1153428
    plot(cr2) +
    ## demonstration of ability to work with missing age classes -age <- c( 2, 3, 4, 5, 7, 9,12) -ct <- c(100,92,83,71,56,35, 1) -cr3 <- chapmanRobson(age,ct,4:12)
    #> Warning: Some 'ages2use' not in observed ages.
    summary(cr3)
    #> Estimate Std. Error +age <- c( 2, 3, 4, 5, 7, 9,12) +ct <- c(100,92,83,71,56,35, 1) +cr3 <- chapmanRobson(age,ct,4:12) +
    #> Warning: Some 'ages2use' not in observed ages.
    summary(cr3) +
    #> Estimate Std. Error #> S 63.2683658 1.8679976 -#> Z 0.4569234 0.1465991
    plot(cr3)
    +#> Z 0.4569234 0.1465991
    plot(cr3) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/chooseColors-1.png b/docs/reference/chooseColors-1.png index 78e8d30e..a687adaa 100644 Binary files a/docs/reference/chooseColors-1.png and b/docs/reference/chooseColors-1.png differ diff --git a/docs/reference/chooseColors-2.png b/docs/reference/chooseColors-2.png index 0bd09fec..9a31e74b 100644 Binary files a/docs/reference/chooseColors-2.png and b/docs/reference/chooseColors-2.png differ diff --git a/docs/reference/chooseColors-3.png b/docs/reference/chooseColors-3.png index 68ff1c41..388c131b 100644 Binary files a/docs/reference/chooseColors-3.png and b/docs/reference/chooseColors-3.png differ diff --git a/docs/reference/chooseColors-4.png b/docs/reference/chooseColors-4.png index 61dcdebb..735365ca 100644 Binary files a/docs/reference/chooseColors-4.png and b/docs/reference/chooseColors-4.png differ diff --git a/docs/reference/chooseColors-5.png b/docs/reference/chooseColors-5.png index e522e842..37056d7f 100644 Binary files a/docs/reference/chooseColors-5.png and b/docs/reference/chooseColors-5.png differ diff --git a/docs/reference/chooseColors-6.png b/docs/reference/chooseColors-6.png index a3204c5d..629c83f6 100644 Binary files a/docs/reference/chooseColors-6.png and b/docs/reference/chooseColors-6.png differ diff --git a/docs/reference/chooseColors.html b/docs/reference/chooseColors.html index d3746690..90568c2b 100644 --- a/docs/reference/chooseColors.html +++ b/docs/reference/chooseColors.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,9 +128,9 @@

    Create a list of colors from among a variety of color palettes.

    Create a list of colors from among a variety of color palettes.

    -
    chooseColors(pal = paletteChoices(), num, rev = FALSE, ...)
    +    
    chooseColors(pal = paletteChoices(), num, rev = FALSE, ...)
     
    -paletteChoices()
    +paletteChoices()

    Arguments

    @@ -159,12 +159,21 @@

    Value

    See also

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    n <- 20 +
    n <- 20 # Color Wheels -pie(rep(1,n), col=chooseColors("rich",n))
    pie(rep(1,n), col=chooseColors("rainbow",n))
    pie(rep(1,n), col=chooseColors("topo",n))
    pie(rep(1,n), col=chooseColors("gray",n))
    pie(rep(1,n), col=chooseColors("jet",n))
    # colors reversed order -pie(rep(1,n), col=chooseColors("jet",n,rev=TRUE))
    +pie(rep(1,n), col=chooseColors("rich",n)) +
    pie(rep(1,n), col=chooseColors("rainbow",n)) +
    pie(rep(1,n), col=chooseColors("topo",n)) +
    pie(rep(1,n), col=chooseColors("gray",n)) +
    pie(rep(1,n), col=chooseColors("jet",n)) +
    # colors reversed order +pie(rep(1,n), col=chooseColors("jet",n,rev=TRUE)) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/col2rgbt.html b/docs/reference/col2rgbt.html index 8ba5267e..c1c5672e 100644 --- a/docs/reference/col2rgbt.html +++ b/docs/reference/col2rgbt.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Converts an R color to RGB (red/green/blue) including a transparency (alpha

    Converts an R color to RGB (red/green/blue) including a transparency (alpha channel). Similar to col2rgb except that a transparency (alpha channel) can be included.

    -
    col2rgbt(col, transp = 1)
    +
    col2rgbt(col, transp = 1)

    Arguments

    @@ -149,11 +149,19 @@

    Value

    See also

    See col2rgb for similar functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    col2rgbt("black")
    #> [1] "#000000FF"
    col2rgbt("black",1/4)
    #> [1] "#00000040"
    clrs <- c("black","blue","red","green") -col2rgbt(clrs)
    #> [1] "#000000FF" "#0000FFFF" "#FF0000FF" "#00FF00FF"
    col2rgbt(clrs,1/4)
    #> [1] "#00000040" "#0000FF40" "#FF000040" "#00FF0040"
    trans <- (1:4)/5 -col2rgbt(clrs,trans)
    #> [1] "#00000033" "#0000FF66" "#FF000099" "#00FF00CC"
    +
    col2rgbt("black") +
    #> [1] "#000000FF"
    col2rgbt("black",1/4) +
    #> [1] "#00000040"
    clrs <- c("black","blue","red","green") +col2rgbt(clrs) +
    #> [1] "#000000FF" "#0000FFFF" "#FF0000FF" "#00FF00FF"
    col2rgbt(clrs,1/4) +
    #> [1] "#00000040" "#0000FF40" "#FF000040" "#00FF0040"
    trans <- (1:4)/5 +col2rgbt(clrs,trans) +
    #> [1] "#00000033" "#0000FF66" "#FF000099" "#00FF00CC"
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/compIntercepts-1.png b/docs/reference/compIntercepts-1.png index b1b2b973..c9fe6b05 100644 Binary files a/docs/reference/compIntercepts-1.png and b/docs/reference/compIntercepts-1.png differ diff --git a/docs/reference/compIntercepts.html b/docs/reference/compIntercepts.html index 9e61bc2d..72e39cf4 100644 --- a/docs/reference/compIntercepts.html +++ b/docs/reference/compIntercepts.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,16 +128,16 @@

    Tests for significant differences among all pairs of intercepts in a dummy v

    Tests for significant differences among all pairs of intercepts in a dummy variable regression where the dummy variables all stem from one factor.

    -
    compIntercepts(
    -  mdl,
    -  common.cov = mean(x),
    -  conf.level = 0.95,
    -  digits = getOption("digits"),
    -  ...
    -)
    +    
    compIntercepts(
    +  mdl,
    +  common.cov = mean(x),
    +  conf.level = 0.95,
    +  digits = getOption("digits"),
    +  ...
    +)
     
     # S3 method for compIntercepts
    -print(x, ...)
    +print(x, ...)

    Arguments

    @@ -191,16 +191,20 @@

    Details

    See also

    TukeyHSD and compSlopes from FSA.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Reduce Mirex data to years where slopes don't differ to illustrate this ## function ... see compSlopes() for analysis of full data set. -Mirex <- Mirex[Mirex$year!="1996" & Mirex$year!="1999",] -Mirex$year <- factor(Mirex$year) +Mirex <- Mirex[Mirex$year!="1996" & Mirex$year!="1999",] +Mirex$year <- factor(Mirex$year) ## Fit DVR, see that slopes don't differ, ## compare intercepts, visualize results -lm1 <- lm(mirex~weight*year,data=Mirex) -anova(lm1)
    #> Analysis of Variance Table +lm1 <- lm(mirex~weight*year,data=Mirex) +anova(lm1) +
    #> Analysis of Variance Table #> #> Response: mirex #> Df Sum Sq Mean Sq F value Pr(>F) @@ -209,7 +213,8 @@

    Examp #> weight:year 3 0.00089 0.00030 0.0704 0.975568 #> Residuals 76 0.32155 0.00423 #> --- -#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    compIntercepts(lm1)
    #> Warning: Removed an interaction term from 'mdl' (i.e., assumed +#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
    compIntercepts(lm1) +
    #> Warning: Removed an interaction term from 'mdl' (i.e., assumed #> parallel lines) to test intercepts.
    #> Tukey HSD on means adjusted assuming parallel lines
    #> comparison diff 95% LCI 95% UCI p.adj #> 1 1982-1977 -0.05416588 -0.10225344 -0.006078329 0.0209412606 #> 2 1986-1977 -0.06545122 -0.11353877 -0.017363664 0.0033259143 @@ -220,8 +225,9 @@

    Examp #> Mean mirex when weight=4.258452

    #> 1977 1982 1986 1992 #> 0.2506358 0.1964699 0.1851846 0.1604194
    ## Fit model without interaction to avoid warning, but ## note that the compIntercepts() results are the same -lm2 <- lm(mirex~weight+year,data=Mirex) -compIntercepts(lm2)
    #> Tukey HSD on means adjusted assuming parallel lines
    #> comparison diff 95% LCI 95% UCI p.adj +lm2 <- lm(mirex~weight+year,data=Mirex) +compIntercepts(lm2) +
    #> Tukey HSD on means adjusted assuming parallel lines
    #> comparison diff 95% LCI 95% UCI p.adj #> 1 1982-1977 -0.05416588 -0.10225344 -0.006078329 0.0209412606 #> 2 1986-1977 -0.06545122 -0.11353877 -0.017363664 0.0033259143 #> 3 1992-1977 -0.09021635 -0.14911133 -0.031321360 0.0007448995 @@ -229,7 +235,8 @@

    Examp #> 5 1992-1982 -0.03605046 -0.09494545 0.022844523 0.3810617955 #> 6 1992-1986 -0.02476513 -0.08366011 0.034129857 0.6885397505

    #> #> Mean mirex when weight=4.258452
    #> 1977 1982 1986 1992 -#> 0.2506358 0.1964699 0.1851846 0.1604194
    fitPlot(lm1,legend="topleft")
    +#> 0.2506358 0.1964699 0.1851846 0.1604194
    fitPlot(lm1,legend="topleft") +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/compSlopes-1.png b/docs/reference/compSlopes-1.png index de2b685b..d387888c 100644 Binary files a/docs/reference/compSlopes-1.png and b/docs/reference/compSlopes-1.png differ diff --git a/docs/reference/compSlopes.html b/docs/reference/compSlopes.html index 8637d060..2a4e15de 100644 --- a/docs/reference/compSlopes.html +++ b/docs/reference/compSlopes.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,16 +128,16 @@

    Tests for significant differences among all pairs of slopes in a dummy varia

    Tests for significant differences among all pairs of slopes in a dummy variable regression where the dummy variables all stem from one factor.

    -
    compSlopes(
    -  mdl,
    -  method = stats::p.adjust.methods,
    -  conf.level = 0.95,
    -  order.slopes = TRUE,
    -  digits = getOption("digits")
    -)
    +    
    compSlopes(
    +  mdl,
    +  method = stats::p.adjust.methods,
    +  conf.level = 0.95,
    +  order.slopes = TRUE,
    +  digits = getOption("digits")
    +)
     
     # S3 method for compSlopes
    -print(x, ...)
    +print(x, ...)

    Arguments

    @@ -204,12 +204,16 @@

    Note

    See also

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    Mirex$year <- factor(Mirex$year) +
    Mirex$year <- factor(Mirex$year) # fit a dummy variable regression, see that slopes differ -lm1 <- lm(mirex~weight*year,data=Mirex) -anova(lm1)
    #> Analysis of Variance Table +lm1 <- lm(mirex~weight*year,data=Mirex) +anova(lm1) +
    #> Analysis of Variance Table #> #> Response: mirex #> Df Sum Sq Mean Sq F value Pr(>F) @@ -219,7 +223,8 @@

    Examp #> Residuals 110 0.40740 0.003704 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    # compare all pairs of slopes using default Holm control -compSlopes(lm1)
    #> Multiple Slope Comparisons (using the 'holm' adjustment)
    #> comparison diff 95% LCI 95% UCI p.unadj p.adj +compSlopes(lm1) +
    #> Multiple Slope Comparisons (using the 'holm' adjustment)
    #> comparison diff 95% LCI 95% UCI p.unadj p.adj #> 1 1982-1977 -0.00202 -0.01678 0.01273 0.78627 1.00000 #> 2 1986-1977 -0.00331 -0.01670 0.01008 0.62556 1.00000 #> 3 1992-1977 -0.00233 -0.01676 0.01211 0.75010 1.00000 @@ -242,7 +247,8 @@

    Examp #> 4 1992 0.02653 0.01705 0.03602 0.0000 0.0000 #> 2 1982 0.02684 0.01688 0.03680 0.0000 0.0000 #> 1 1977 0.02886 0.01798 0.03974 0.0000 0.0000

    # compare all pairs of slopes using the false discovery rate control -compSlopes(lm1,method="fdr")
    #> Multiple Slope Comparisons (using the 'fdr' adjustment)
    #> comparison diff 95% LCI 95% UCI p.unadj p.adj +compSlopes(lm1,method="fdr") +
    #> Multiple Slope Comparisons (using the 'fdr' adjustment)
    #> comparison diff 95% LCI 95% UCI p.unadj p.adj #> 1 1982-1977 -0.00202 -0.01678 0.01273 0.78627 0.93698 #> 2 1986-1977 -0.00331 -0.01670 0.01008 0.62556 0.93698 #> 3 1992-1977 -0.00233 -0.01676 0.01211 0.75010 0.93698 @@ -265,7 +271,8 @@

    Examp #> 4 1992 0.02653 0.01705 0.03602 0.0000 0.00000 #> 2 1982 0.02684 0.01688 0.03680 0.0000 0.00000 #> 1 1977 0.02886 0.01798 0.03974 0.0000 0.00000

    # visualize the results -fitPlot(lm1)
    +fitPlot(lm1) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/depletion-1.png b/docs/reference/depletion-1.png index 2809b0f4..71528481 100644 Binary files a/docs/reference/depletion-1.png and b/docs/reference/depletion-1.png differ diff --git a/docs/reference/depletion-2.png b/docs/reference/depletion-2.png index 14bf4a65..61e4fbad 100644 Binary files a/docs/reference/depletion-2.png and b/docs/reference/depletion-2.png differ diff --git a/docs/reference/depletion-3.png b/docs/reference/depletion-3.png index 5036321f..91d6da0b 100644 Binary files a/docs/reference/depletion-3.png and b/docs/reference/depletion-3.png differ diff --git a/docs/reference/depletion-4.png b/docs/reference/depletion-4.png index a95936e8..1c20625b 100644 Binary files a/docs/reference/depletion-4.png and b/docs/reference/depletion-4.png differ diff --git a/docs/reference/depletion.html b/docs/reference/depletion.html index acac27fa..6a004b90 100644 --- a/docs/reference/depletion.html +++ b/docs/reference/depletion.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,48 +128,48 @@

    Computes the Leslie or DeLury population estimate from catch and effort data

    Computes the Leslie or DeLury estimates of population size and catchability coefficient from paired catch and effort data. The Ricker modification may also be used.

    -
    depletion(
    -  catch,
    -  effort,
    -  method = c("Leslie", "DeLury", "Delury"),
    -  Ricker.mod = FALSE
    -)
    +    
    depletion(
    +  catch,
    +  effort,
    +  method = c("Leslie", "DeLury", "Delury"),
    +  Ricker.mod = FALSE
    +)
     
     # S3 method for depletion
    -summary(object, parm = c("all", "both", "No", "q", "lm"), verbose = FALSE, ...)
    +summary(object, parm = c("all", "both", "No", "q", "lm"), verbose = FALSE, ...)
     
     # S3 method for depletion
    -coef(object, parm = c("all", "both", "No", "q", "lm"), ...)
    +coef(object, parm = c("all", "both", "No", "q", "lm"), ...)
     
     # S3 method for depletion
    -confint(
    -  object,
    -  parm = c("all", "both", "No", "q", "lm"),
    -  level = conf.level,
    -  conf.level = 0.95,
    -  ...
    -)
    +confint(
    +  object,
    +  parm = c("all", "both", "No", "q", "lm"),
    +  level = conf.level,
    +  conf.level = 0.95,
    +  ...
    +)
     
     # S3 method for depletion
    -anova(object, ...)
    +anova(object, ...)
     
     # S3 method for depletion
    -rSquared(object, digits = getOption("digits"), percent = FALSE, ...)
    +rSquared(object, digits = getOption("digits"), percent = FALSE, ...)
     
     # S3 method for depletion
    -plot(
    -  x,
    -  xlab = NULL,
    -  ylab = NULL,
    -  pch = 19,
    -  col.pt = "black",
    -  col.mdl = "gray70",
    -  lwd = 1,
    -  lty = 1,
    -  pos.est = "topright",
    -  cex.est = 0.95,
    -  ...
    -)
    +plot( + x, + xlab = NULL, + ylab = NULL, + pch = 19, + col.pt = "black", + col.mdl = "gray70", + lwd = 1, + lty = 1, + pos.est = "topright", + cex.est = 0.95, + ... +)

    Arguments

    @@ -291,27 +291,39 @@

    <

    10-Abundance from Depletion Data.

    References

    -

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

    +

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

    Ricker, W.E. 1975. Computation and interpretation of biological statistics of fish populations. Technical Report Bulletin 191, Bulletin of the Fisheries Research Board of Canada. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/1485.pdf.]

    Seber, G.A.F. 2002. The Estimation of Animal Abundance. Edward Arnold, Second edition (reprinted).

    See also

    See removal for related functionality and deplet in fishmethods for similar functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Leslie model examples # no Ricker modification -l1 <- depletion(SMBassLS$catch,SMBassLS$effort,method="Leslie") -summary(l1)
    #> Estimate Std. Err. +l1 <- depletion(SMBassLS$catch,SMBassLS$effort,method="Leslie") +summary(l1) +
    #> Estimate Std. Err. #> No 1.060296e+03 1.692676e+02 -#> q 1.484403e-02 3.520491e-03
    summary(l1,verbose=TRUE)
    #> The Leslie method was used.
    #> Estimate Std. Err. +#> q 1.484403e-02 3.520491e-03
    summary(l1,verbose=TRUE) +
    #> The Leslie method was used.
    #> Estimate Std. Err. #> No 1.060296e+03 1.692676e+02 -#> q 1.484403e-02 3.520491e-03
    summary(l1,parm="No")
    #> Estimate Std. Err. -#> No 1060.296 169.2676
    #> [1] 0.6896648
    rSquared(l1,digits=1,percent=TRUE)
    #> [1] 69
    cbind(Est=coef(l1),confint(l1))
    #> Est 95% LCI 95% UCI +#> q 1.484403e-02 3.520491e-03
    summary(l1,parm="No") +
    #> Estimate Std. Err. +#> No 1060.296 169.2676
    rSquared(l1) +
    #> [1] 0.6896648
    rSquared(l1,digits=1,percent=TRUE) +
    #> [1] 69
    cbind(Est=coef(l1),confint(l1)) +
    #> Est 95% LCI 95% UCI #> No 1.060296e+03 6.699638e+02 1.450627e+03 -#> q 1.484403e-02 6.725759e-03 2.296229e-02
    cbind(Est=coef(l1,parm="No"),confint(l1,parm="No"))
    #> Est 95% LCI 95% UCI -#> No 1060.296 669.9638 1450.627
    cbind(Est=coef(l1,parm="q"),confint(l1,parm="q"))
    #> Est 95% LCI 95% UCI -#> q 0.01484403 0.006725759 0.02296229
    summary(l1,parm="lm")
    #> +#> q 1.484403e-02 6.725759e-03 2.296229e-02
    cbind(Est=coef(l1,parm="No"),confint(l1,parm="No")) +
    #> Est 95% LCI 95% UCI +#> No 1060.296 669.9638 1450.627
    cbind(Est=coef(l1,parm="q"),confint(l1,parm="q")) +
    #> Est 95% LCI 95% UCI +#> q 0.01484403 0.006725759 0.02296229
    summary(l1,parm="lm") +
    #> #> Call: #> stats::lm(formula = cpe ~ K) #> @@ -329,25 +341,35 @@

    Examp #> Residual standard error: 2.295 on 8 degrees of freedom #> Multiple R-squared: 0.6897, Adjusted R-squared: 0.6509 #> F-statistic: 17.78 on 1 and 8 DF, p-value: 0.00293 -#>

    plot(l1)
    +#>
    plot(l1) +
    # with Ricker modification -l2 <- depletion(SMBassLS$catch,SMBassLS$effort,method="Leslie",Ricker.mod=TRUE) -summary(l2)
    #> Estimate Std. Err. +l2 <- depletion(SMBassLS$catch,SMBassLS$effort,method="Leslie",Ricker.mod=TRUE) +summary(l2) +
    #> Estimate Std. Err. #> No 1.077571e+03 1.778035e+02 -#> q 1.525078e-02 3.911632e-03
    cbind(Est=coef(l2),confint(l1))
    #> Est 95% LCI 95% UCI +#> q 1.525078e-02 3.911632e-03
    cbind(Est=coef(l2),confint(l1)) +
    #> Est 95% LCI 95% UCI #> No 1.077571e+03 6.699638e+02 1.450627e+03 -#> q 1.525078e-02 6.725759e-03 2.296229e-02
    plot(l2)
    +#> q 1.525078e-02 6.725759e-03 2.296229e-02
    plot(l2) +
    ## DeLury model examples # no Ricker modification -d1 <- depletion(SMBassLS$catch,SMBassLS$effort,method="DeLury") -summary(d1)
    #> Estimate Std. Err. +d1 <- depletion(SMBassLS$catch,SMBassLS$effort,method="DeLury") +summary(d1) +
    #> Estimate Std. Err. #> No 1.098503e+03 1.916049e+02 -#> q 1.319375e-02 3.585777e-03
    summary(d1,parm="q")
    #> Estimate Std. Err. -#> q 0.01319375 0.003585777
    summary(d1,verbose=TRUE)
    #> The DeLury method was used.
    #> Estimate Std. Err. +#> q 1.319375e-02 3.585777e-03
    summary(d1,parm="q") +
    #> Estimate Std. Err. +#> q 0.01319375 0.003585777
    summary(d1,verbose=TRUE) +
    #> The DeLury method was used.
    #> Estimate Std. Err. #> No 1.098503e+03 1.916049e+02 -#> q 1.319375e-02 3.585777e-03
    #> [1] 0.6285719
    cbind(Est=coef(d1),confint(d1))
    #> Est 95% LCI 95% UCI +#> q 1.319375e-02 3.585777e-03
    rSquared(d1) +
    #> [1] 0.6285719
    cbind(Est=coef(d1),confint(d1)) +
    #> Est 95% LCI 95% UCI #> No 1.098503e+03 6.566616e+02 1.540345e+03 -#> q 1.319375e-02 4.924937e-03 2.146257e-02
    summary(d1,parm="lm")
    #> +#> q 1.319375e-02 4.924937e-03 2.146257e-02
    summary(d1,parm="lm") +
    #> #> Call: #> stats::lm(formula = log(cpe) ~ E) #> @@ -365,15 +387,20 @@

    Examp #> Residual standard error: 0.228 on 8 degrees of freedom #> Multiple R-squared: 0.6286, Adjusted R-squared: 0.5821 #> F-statistic: 13.54 on 1 and 8 DF, p-value: 0.006224 -#>

    plot(d1)
    +#>
    plot(d1) +
    # with Ricker modification -d2 <- depletion(SMBassLS$catch,SMBassLS$effort,method="DeLury",Ricker.mod=TRUE) -summary(d2)
    #> Estimate Std. Err. +d2 <- depletion(SMBassLS$catch,SMBassLS$effort,method="DeLury",Ricker.mod=TRUE) +summary(d2) +
    #> Estimate Std. Err. #> No 1.150420e+03 1.876083e+02 -#> q 1.319375e-02 3.585777e-03
    cbind(Est=coef(d2),confint(d2))
    #> Est 95% LCI 95% UCI +#> q 1.319375e-02 3.585777e-03
    cbind(Est=coef(d2),confint(d2)) +
    #> Est 95% LCI 95% UCI #> No 1.150420e+03 7.177940e+02 1.583045e+03 -#> q 1.319375e-02 4.924937e-03 2.146257e-02
    cbind(Est=coef(d2,parm="q"),confint(d2,parm="q"))
    #> Est 95% LCI 95% UCI -#> q 0.01319375 0.004924937 0.02146257
    plot(d2)
    +#> q 1.319375e-02 4.924937e-03 2.146257e-02
    cbind(Est=coef(d2,parm="q"),confint(d2,parm="q")) +
    #> Est 95% LCI 95% UCI +#> q 0.01319375 0.004924937 0.02146257
    plot(d2) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/diags.html b/docs/reference/diags.html index 2ebdb913..60c3cd62 100644 --- a/docs/reference/diags.html +++ b/docs/reference/diags.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,13 +128,13 @@

    Extract diagonals from a matrix.

    Extract diagonals from a matrix.

    -
    diags(
    -  x,
    -  which = 0,
    -  incl.labels = c("none", "row", "column"),
    -  val.name = "value",
    -  label.name = "label"
    -)
    +
    diags(
    +  x,
    +  which = 0,
    +  incl.labels = c("none", "row", "column"),
    +  val.name = "value",
    +  label.name = "label"
    +)

    Arguments

    @@ -164,83 +164,106 @@

    Arg

    Value

    A data.frame with one variable that contains the values from the chosen diagonal of x and, optionally, a second variable that contains the chosen labels for those values.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com, but relied heavily on https://stackoverflow.com/a/27935808/1123933/.

    Examples

    ## Square numeric matrix -mat1 <- matrix(1:16,nrow=4) -colnames(mat1) <- LETTERS[1:ncol(mat1)] -rownames(mat1) <- 1:nrow(mat1) -mat1
    #> A B C D +mat1 <- matrix(1:16,nrow=4) +colnames(mat1) <- LETTERS[1:ncol(mat1)] +rownames(mat1) <- 1:nrow(mat1) +mat1 +
    #> A B C D #> 1 1 5 9 13 #> 2 2 6 10 14 #> 3 3 7 11 15 -#> 4 4 8 12 16
    diags(mat1,which=NULL)
    #> Indices matrix corresponding to 'x'. +#> 4 4 8 12 16
    diags(mat1,which=NULL) +
    #> Indices matrix corresponding to 'x'. #> A B C D #> 1 0 -1 -2 -3 #> 2 1 0 -1 -2 #> 3 2 1 0 -1 #> 4 3 2 1 0 -#>
    diags(mat1)
    #> value +#>
    diags(mat1) +
    #> value #> 1 1 #> 2 6 #> 3 11 -#> 4 16
    diags(mat1,which=-1)
    #> value +#> 4 16
    diags(mat1,which=-1) +
    #> value #> 1 5 #> 2 10 -#> 3 15
    diags(mat1,which=2)
    #> value +#> 3 15
    diags(mat1,which=2) +
    #> value #> 1 3 -#> 2 8
    diags(mat1,incl.labels="row")
    #> label value +#> 2 8
    diags(mat1,incl.labels="row") +
    #> label value #> 1 1 1 #> 2 2 6 #> 3 3 11 -#> 4 4 16
    diags(mat1,which=2,incl.labels="row")
    #> label value +#> 4 4 16
    diags(mat1,which=2,incl.labels="row") +
    #> label value #> 1 3 3 -#> 2 4 8
    diags(mat1,which=2,incl.labels="col")
    #> label value +#> 2 4 8
    diags(mat1,which=2,incl.labels="col") +
    #> label value #> 1 A 3 -#> 2 B 8
    ( tmp <- diags(mat1,which=2,incl.labels="row",val.name="Freq",label.name="age") )
    #> age Freq +#> 2 B 8
    ( tmp <- diags(mat1,which=2,incl.labels="row",val.name="Freq",label.name="age") ) +
    #> age Freq #> 1 3 3 -#> 2 4 8
    str(tmp)
    #> 'data.frame': 2 obs. of 2 variables: +#> 2 4 8
    str(tmp) +
    #> 'data.frame': 2 obs. of 2 variables: #> $ age : num 3 4 #> $ Freq: int 3 8
    ## Rectangular numeric matrix -mat2 <- matrix(1:20,nrow=4) -colnames(mat2) <- LETTERS[1:ncol(mat2)] -rownames(mat2) <- 1:nrow(mat2) -mat2
    #> A B C D E +mat2 <- matrix(1:20,nrow=4) +colnames(mat2) <- LETTERS[1:ncol(mat2)] +rownames(mat2) <- 1:nrow(mat2) +mat2 +
    #> A B C D E #> 1 1 5 9 13 17 #> 2 2 6 10 14 18 #> 3 3 7 11 15 19 -#> 4 4 8 12 16 20
    diags(mat2,which=NULL)
    #> Indices matrix corresponding to 'x'. +#> 4 4 8 12 16 20
    diags(mat2,which=NULL) +
    #> Indices matrix corresponding to 'x'. #> A B C D E #> 1 0 -1 -2 -3 -4 #> 2 1 0 -1 -2 -3 #> 3 2 1 0 -1 -2 #> 4 3 2 1 0 -1 -#>
    diags(mat2,which=-1,incl.labels="row")
    #> label value +#>
    diags(mat2,which=-1,incl.labels="row") +
    #> label value #> 1 1 5 #> 2 2 10 #> 3 3 15 -#> 4 4 20
    diags(mat2,which=2,incl.labels="row")
    #> label value +#> 4 4 20
    diags(mat2,which=2,incl.labels="row") +
    #> label value #> 1 3 3 -#> 2 4 8
    diags(mat2,which=-4,incl.labels="col")
    #> label value +#> 2 4 8
    diags(mat2,which=-4,incl.labels="col") +
    #> label value #> 1 E 17
    ## Rectangular character matrix -mat3 <- matrix(LETTERS[1:24],nrow=3) -colnames(mat3) <- letters[1:ncol(mat3)] -rownames(mat3) <- 1:nrow(mat3) -mat3
    #> a b c d e f g h +mat3 <- matrix(LETTERS[1:24],nrow=3) +colnames(mat3) <- letters[1:ncol(mat3)] +rownames(mat3) <- 1:nrow(mat3) +mat3 +
    #> a b c d e f g h #> 1 "A" "D" "G" "J" "M" "P" "S" "V" #> 2 "B" "E" "H" "K" "N" "Q" "T" "W" -#> 3 "C" "F" "I" "L" "O" "R" "U" "X"
    diags(mat3,which=NULL)
    #> Indices matrix corresponding to 'x'. +#> 3 "C" "F" "I" "L" "O" "R" "U" "X"
    diags(mat3,which=NULL) +
    #> Indices matrix corresponding to 'x'. #> a b c d e f g h #> 1 0 -1 -2 -3 -4 -5 -6 -7 #> 2 1 0 -1 -2 -3 -4 -5 -6 #> 3 2 1 0 -1 -2 -3 -4 -5 -#>
    diags(mat3,which=-1,incl.labels="row")
    #> label value +#>
    diags(mat3,which=-1,incl.labels="row") +
    #> label value #> 1 1 D #> 2 2 H -#> 3 3 L
    diags(mat3,which=2,incl.labels="row")
    #> label value -#> 1 3 C
    diags(mat3,which=-4,incl.labels="col")
    #> label value +#> 3 3 L
    diags(mat3,which=2,incl.labels="row") +
    #> label value +#> 1 3 C
    diags(mat3,which=-4,incl.labels="col") +
    #> label value #> 1 e M #> 2 f Q #> 3 g U
    @@ -260,7 +283,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/dunnTest.html b/docs/reference/dunnTest.html index 370d3ee1..0e8bf47e 100644 --- a/docs/reference/dunnTest.html +++ b/docs/reference/dunnTest.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,30 +128,30 @@

    Dunn's Kruskal-Wallis Multiple Comparisons.

    Performs Dunn's (1964) test of multiple comparisons following a significant Kruskal-Wallis test, possibly with a correction to control the experimentwise error rate. This is largely a wrapper for the dunn.test function in dunn.test. Please see and cite that package.

    -
    dunnTest(x, ...)
    +    
    dunnTest(x, ...)
     
     # S3 method for default
    -dunnTest(
    -  x,
    -  g,
    -  method = dunn.test::p.adjustment.methods[c(4, 2:3, 5:8, 1)],
    -  two.sided = TRUE,
    -  altp = two.sided,
    -  ...
    -)
    +dunnTest(
    +  x,
    +  g,
    +  method = dunn.test::p.adjustment.methods[c(4, 2:3, 5:8, 1)],
    +  two.sided = TRUE,
    +  altp = two.sided,
    +  ...
    +)
     
     # S3 method for formula
    -dunnTest(
    -  x,
    -  data = NULL,
    -  method = dunn.test::p.adjustment.methods[c(4, 2:3, 5:8, 1)],
    -  two.sided = TRUE,
    -  altp = two.sided,
    -  ...
    -)
    +dunnTest(
    +  x,
    +  data = NULL,
    +  method = dunn.test::p.adjustment.methods[c(4, 2:3, 5:8, 1)],
    +  two.sided = TRUE,
    +  altp = two.sided,
    +  ...
    +)
     
     # S3 method for dunnTest
    -print(x, dunn.test.results = FALSE, ...)
    +print(x, dunn.test.results = FALSE, ...)

    Arguments

    @@ -218,18 +218,22 @@

    R

    See also

    See kruskal.test, dunn.test in dunn.test, posthoc.kruskal.nemenyi.test in PMCMR, kruskalmc in pgirmess, and kruskal in agricolae.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com, but this is largely a wrapper (see details) for dunn.test in dunn.test written by Alexis Dinno.

    Examples

    ## pH in four ponds data from Zar (2010) -ponds <- data.frame(pond=as.factor(rep(1:4,each=8)), - pH=c(7.68,7.69,7.70,7.70,7.72,7.73,7.73,7.76, +ponds <- data.frame(pond=as.factor(rep(1:4,each=8)), + pH=c(7.68,7.69,7.70,7.70,7.72,7.73,7.73,7.76, 7.71,7.73,7.74,7.74,7.78,7.78,7.80,7.81, - 7.74,7.75,7.77,7.78,7.80,7.81,7.84,NA, - 7.71,7.71,7.74,7.79,7.81,7.85,7.87,7.91)) -ponds2 <- ponds[complete.cases(ponds),] + 7.74,7.75,7.77,7.78,7.80,7.81,7.84,NA, + 7.71,7.71,7.74,7.79,7.81,7.85,7.87,7.91)) +ponds2 <- ponds[complete.cases(ponds),] # non-formula usage (default "holm" method) -dunnTest(ponds2$pH,ponds2$pond)
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Holm method.
    #> Comparison Z P.unadj P.adj +dunnTest(ponds2$pH,ponds2$pond) +
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Holm method.
    #> Comparison Z P.unadj P.adj #> 1 1 - 2 -2.13700630 0.032597479 0.13038992 #> 2 1 - 3 -2.94934889 0.003184443 0.01592221 #> 3 2 - 3 -0.88480467 0.376261991 1.00000000 @@ -237,7 +241,8 @@

    Examp #> 5 2 - 4 -0.85480252 0.392660483 0.78532097 #> 6 3 - 4 0.05898698 0.952962480 0.95296248

    # formula usage (default "holm" method) -dunnTest(pH~pond,data=ponds2)
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Holm method.
    #> Comparison Z P.unadj P.adj +dunnTest(pH~pond,data=ponds2) +
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Holm method.
    #> Comparison Z P.unadj P.adj #> 1 1 - 2 -2.13700630 0.032597479 0.13038992 #> 2 1 - 3 -2.94934889 0.003184443 0.01592221 #> 3 2 - 3 -0.88480467 0.376261991 1.00000000 @@ -245,19 +250,22 @@

    Examp #> 5 2 - 4 -0.85480252 0.392660483 0.78532097 #> 6 3 - 4 0.05898698 0.952962480 0.95296248

    # other methods -dunnTest(pH~pond,data=ponds2,method="bonferroni")
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Bonferroni method.
    #> Comparison Z P.unadj P.adj +dunnTest(pH~pond,data=ponds2,method="bonferroni") +
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Bonferroni method.
    #> Comparison Z P.unadj P.adj #> 1 1 - 2 -2.13700630 0.032597479 0.19558488 #> 2 1 - 3 -2.94934889 0.003184443 0.01910666 #> 3 2 - 3 -0.88480467 0.376261991 1.00000000 #> 4 1 - 4 -2.99180882 0.002773299 0.01663979 #> 5 2 - 4 -0.85480252 0.392660483 1.00000000 -#> 6 3 - 4 0.05898698 0.952962480 1.00000000
    dunnTest(pH~pond,data=ponds2,method="bh")
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Benjamini-Hochberg method.
    #> Comparison Z P.unadj P.adj +#> 6 3 - 4 0.05898698 0.952962480 1.00000000
    dunnTest(pH~pond,data=ponds2,method="bh") +
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Benjamini-Hochberg method.
    #> Comparison Z P.unadj P.adj #> 1 1 - 2 -2.13700630 0.032597479 0.065194958 #> 2 1 - 3 -2.94934889 0.003184443 0.009553328 #> 3 2 - 3 -0.88480467 0.376261991 0.564392987 #> 4 1 - 4 -2.99180882 0.002773299 0.016639793 #> 5 2 - 4 -0.85480252 0.392660483 0.471192580 -#> 6 3 - 4 0.05898698 0.952962480 0.952962480
    dunnTest(pH~pond,data=ponds2,method="none")
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> with no adjustment for p-values.
    #> Comparison Z P.unadj P.adj +#> 6 3 - 4 0.05898698 0.952962480 0.952962480
    dunnTest(pH~pond,data=ponds2,method="none") +
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> with no adjustment for p-values.
    #> Comparison Z P.unadj P.adj #> 1 1 - 2 -2.13700630 0.032597479 0.032597479 #> 2 1 - 3 -2.94934889 0.003184443 0.003184443 #> 3 2 - 3 -0.88480467 0.376261991 0.376261991 @@ -265,7 +273,8 @@

    Examp #> 5 2 - 4 -0.85480252 0.392660483 0.392660483 #> 6 3 - 4 0.05898698 0.952962480 0.952962480

    # one-sided -dunnTest(pH~pond,data=ponds2,two.sided=FALSE)
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Holm method.
    #> Comparison Z P.unadj P.adj +dunnTest(pH~pond,data=ponds2,two.sided=FALSE) +
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Holm method.
    #> Comparison Z P.unadj P.adj #> 1 1 - 2 -2.13700630 0.016298740 0.065194958 #> 2 1 - 3 -2.94934889 0.001592221 0.007961106 #> 3 2 - 3 -0.88480467 0.188130996 0.564392987 @@ -273,7 +282,8 @@

    Examp #> 5 2 - 4 -0.85480252 0.196330241 0.392660483 #> 6 3 - 4 0.05898698 0.476481240 0.476481240

    # warning message if incomplete cases were removed -dunnTest(pH~pond,data=ponds)
    #> Warning: Some rows deleted from 'x' and 'g' because missing data.
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Holm method.
    #> Comparison Z P.unadj P.adj +dunnTest(pH~pond,data=ponds) +
    #> Warning: Some rows deleted from 'x' and 'g' because missing data.
    #> Dunn (1964) Kruskal-Wallis multiple comparison
    #> p-values adjusted with the Holm method.
    #> Comparison Z P.unadj P.adj #> 1 1 - 2 -2.13700630 0.032597479 0.13038992 #> 2 1 - 3 -2.94934889 0.003184443 0.01592221 #> 3 2 - 3 -0.88480467 0.376261991 1.00000000 @@ -281,8 +291,9 @@

    Examp #> 5 2 - 4 -0.85480252 0.392660483 0.78532097 #> 6 3 - 4 0.05898698 0.952962480 0.95296248

    # print dunn.test results -tmp <- dunnTest(pH~pond,data=ponds2) -print(tmp,dunn.test.results=TRUE)
    #> Kruskal-Wallis rank sum test +tmp <- dunnTest(pH~pond,data=ponds2) +print(tmp,dunn.test.results=TRUE) +
    #> Kruskal-Wallis rank sum test #> #> data: x and g #> Kruskal-Wallis chi-squared = 11.9435, df = 3, p-value = 0.01 @@ -320,7 +331,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/expandCounts.html b/docs/reference/expandCounts.html index 1069f7aa..311e41d4 100644 --- a/docs/reference/expandCounts.html +++ b/docs/reference/expandCounts.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,17 +128,17 @@

    Repeat individual fish data (including lengths) from tallied counts.

    Repeat individual fish data, including lengths, from tallied counts and, optionally, add a random digit to length measurements to simulate actual length of fish in the bin. This is useful as a precursor to summaries that require information, e.g., lengths, of individual fish (e.g., length frequency histograms, means lengths).

    -
    expandCounts(
    -  data,
    -  cform,
    -  lform = NULL,
    -  removeCount = TRUE,
    -  lprec = 0.1,
    -  new.name = "newlen",
    -  cwid = 0,
    -  verbose = TRUE,
    -  ...
    -)
    +
    expandCounts(
    +  data,
    +  cform,
    +  lform = NULL,
    +  removeCount = TRUE,
    +  lprec = 0.1,
    +  new.name = "newlen",
    +  cwid = 0,
    +  verbose = TRUE,
    +  ...
    +)

    Arguments

    @@ -192,19 +192,24 @@

    Details

    See also

    See expandLenFreq for expanding length frequencies where individual fish measurements were made on individual fish in a subsample and the remaining fish were simply counted.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    # all need expansion -( d1 <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), - lwr.bin=c(15,15.5,16,16,17,17), - upr.bin=c(15.5,16,16.5,16.5,17.5,17.5), - freq=c(6,4,2,3,1,1)) )
    #> name lwr.bin upr.bin freq +( d1 <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), + lwr.bin=c(15,15.5,16,16,17,17), + upr.bin=c(15.5,16,16.5,16.5,17.5,17.5), + freq=c(6,4,2,3,1,1)) ) +
    #> name lwr.bin upr.bin freq #> 1 Johnson 15.0 15.5 6 #> 2 Johnson 15.5 16.0 4 #> 3 Jones 16.0 16.5 2 #> 4 Frank 16.0 16.5 3 #> 5 Frank 17.0 17.5 1 -#> 6 Max 17.0 17.5 1
    expandCounts(d1,~freq)
    #> Results messages from expandCounts(): +#> 6 Max 17.0 17.5 1
    expandCounts(d1,~freq) +
    #> Results messages from expandCounts(): #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin #> 1 Frank 17.0 17.5 @@ -223,7 +228,8 @@

    Examp #> 14 Jones 16.0 16.5 #> 15 Frank 16.0 16.5 #> 16 Frank 16.0 16.5 -#> 17 Frank 16.0 16.5

    expandCounts(d1,~freq,~lwr.bin+upr.bin)
    #> Results messages from expandCounts(): +#> 17 Frank 16.0 16.5
    expandCounts(d1,~freq,~lwr.bin+upr.bin) +
    #> Results messages from expandCounts(): #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin newlen lennote #> 1 Frank 17.0 17.5 17.2 Expanded length @@ -244,16 +250,18 @@

    Examp #> 16 Frank 16.0 16.5 16.5 Expanded length #> 17 Frank 16.0 16.5 16.2 Expanded length

    # some need expansion -( d2 <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), - lwr.bin=c(15,15.5,16,16,17.1,17.3), - upr.bin=c(15.5,16,16.5,16.5,17.1,17.3), - freq=c(6,4,2,3,1,1)) )
    #> name lwr.bin upr.bin freq +( d2 <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), + lwr.bin=c(15,15.5,16,16,17.1,17.3), + upr.bin=c(15.5,16,16.5,16.5,17.1,17.3), + freq=c(6,4,2,3,1,1)) ) +
    #> name lwr.bin upr.bin freq #> 1 Johnson 15.0 15.5 6 #> 2 Johnson 15.5 16.0 4 #> 3 Jones 16.0 16.5 2 #> 4 Frank 16.0 16.5 3 #> 5 Frank 17.1 17.1 1 -#> 6 Max 17.3 17.3 1
    expandCounts(d2,~freq)
    #> Results messages from expandCounts(): +#> 6 Max 17.3 17.3 1
    expandCounts(d2,~freq) +
    #> Results messages from expandCounts(): #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin #> 1 Frank 17.1 17.1 @@ -272,7 +280,8 @@

    Examp #> 14 Jones 16.0 16.5 #> 15 Frank 16.0 16.5 #> 16 Frank 16.0 16.5 -#> 17 Frank 16.0 16.5

    expandCounts(d2,~freq,~lwr.bin+upr.bin)
    #> Results messages from expandCounts(): +#> 17 Frank 16.0 16.5
    expandCounts(d2,~freq,~lwr.bin+upr.bin) +
    #> Results messages from expandCounts(): #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin newlen lennote #> 1 Frank 17.1 17.1 17.1 Observed length @@ -293,16 +302,18 @@

    Examp #> 16 Frank 16.0 16.5 16.4 Expanded length #> 17 Frank 16.0 16.5 16.5 Expanded length

    # none need expansion -( d3 <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), - lwr.bin=c(15,15.5,16,16,17.1,17.3), - upr.bin=c(15,15.5,16,16,17.1,17.3), - freq=c(6,4,2,3,1,1)) )
    #> name lwr.bin upr.bin freq +( d3 <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), + lwr.bin=c(15,15.5,16,16,17.1,17.3), + upr.bin=c(15,15.5,16,16,17.1,17.3), + freq=c(6,4,2,3,1,1)) ) +
    #> name lwr.bin upr.bin freq #> 1 Johnson 15.0 15.0 6 #> 2 Johnson 15.5 15.5 4 #> 3 Jones 16.0 16.0 2 #> 4 Frank 16.0 16.0 3 #> 5 Frank 17.1 17.1 1 -#> 6 Max 17.3 17.3 1
    expandCounts(d3,~freq)
    #> Results messages from expandCounts(): +#> 6 Max 17.3 17.3 1
    expandCounts(d3,~freq) +
    #> Results messages from expandCounts(): #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin #> 1 Frank 17.1 17.1 @@ -321,7 +332,8 @@

    Examp #> 14 Jones 16.0 16.0 #> 15 Frank 16.0 16.0 #> 16 Frank 16.0 16.0 -#> 17 Frank 16.0 16.0

    expandCounts(d3,~freq,~lwr.bin+upr.bin)
    #> Results messages from expandCounts(): +#> 17 Frank 16.0 16.0
    expandCounts(d3,~freq,~lwr.bin+upr.bin) +
    #> Results messages from expandCounts(): #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin newlen lennote #> 1 Frank 17.1 17.1 17.1 Observed length @@ -342,16 +354,18 @@

    Examp #> 16 Frank 16.0 16.0 16.0 Observed length #> 17 Frank 16.0 16.0 16.0 Observed length

    # some need expansion, but different bin widths -( d4 <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), - lwr.bin=c(15, 15, 16, 16, 17.1,17.3), - upr.bin=c(15.5,15.9,16.5,16.9,17.1,17.3), - freq=c(6,4,2,3,1,1)) )
    #> name lwr.bin upr.bin freq +( d4 <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), + lwr.bin=c(15, 15, 16, 16, 17.1,17.3), + upr.bin=c(15.5,15.9,16.5,16.9,17.1,17.3), + freq=c(6,4,2,3,1,1)) ) +
    #> name lwr.bin upr.bin freq #> 1 Johnson 15.0 15.5 6 #> 2 Johnson 15.0 15.9 4 #> 3 Jones 16.0 16.5 2 #> 4 Frank 16.0 16.9 3 #> 5 Frank 17.1 17.1 1 -#> 6 Max 17.3 17.3 1
    expandCounts(d4,~freq)
    #> Results messages from expandCounts(): +#> 6 Max 17.3 17.3 1
    expandCounts(d4,~freq) +
    #> Results messages from expandCounts(): #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin #> 1 Frank 17.1 17.1 @@ -370,7 +384,8 @@

    Examp #> 14 Jones 16.0 16.5 #> 15 Frank 16.0 16.9 #> 16 Frank 16.0 16.9 -#> 17 Frank 16.0 16.9

    expandCounts(d4,~freq,~lwr.bin+upr.bin)
    #> Results messages from expandCounts(): +#> 17 Frank 16.0 16.9
    expandCounts(d4,~freq,~lwr.bin+upr.bin) +
    #> Results messages from expandCounts(): #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin newlen lennote #> 1 Frank 17.1 17.1 17.1 Observed length @@ -391,10 +406,11 @@

    Examp #> 16 Frank 16.0 16.9 16.4 Expanded length #> 17 Frank 16.0 16.9 16.4 Expanded length

    # some need expansion but include zeros and NAs for counts -( d2a <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max","Max","Max","Max"), - lwr.bin=c(15, 15.5,16 ,16 ,17.1,17.3,NA,NA,NA), - upr.bin=c(15.5,16 ,16.5,16.5,17.1,17.3,NA,NA,NA), - freq=c(6,4,2,3,1,1,NA,0,NA)) )
    #> name lwr.bin upr.bin freq +( d2a <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max","Max","Max","Max"), + lwr.bin=c(15, 15.5,16 ,16 ,17.1,17.3,NA,NA,NA), + upr.bin=c(15.5,16 ,16.5,16.5,17.1,17.3,NA,NA,NA), + freq=c(6,4,2,3,1,1,NA,0,NA)) ) +
    #> name lwr.bin upr.bin freq #> 1 Johnson 15.0 15.5 6 #> 2 Johnson 15.5 16.0 4 #> 3 Jones 16.0 16.5 2 @@ -403,7 +419,8 @@

    Examp #> 6 Max 17.3 17.3 1 #> 7 Max NA NA NA #> 8 Max NA NA 0 -#> 9 Max NA NA NA

    expandCounts(d2a,~freq,~lwr.bin+upr.bin)
    #> Results messages from expandCounts(): +#> 9 Max NA NA NA
    expandCounts(d2a,~freq,~lwr.bin+upr.bin) +
    #> Results messages from expandCounts(): #> Rows 7, 8, 9 had zero or no counts in freq. #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin newlen lennote @@ -426,18 +443,20 @@

    Examp #> 17 Jones 16.0 16.5 16.5 Expanded length #> 18 Frank 16.0 16.5 16.0 Expanded length #> 19 Frank 16.0 16.5 16.0 Expanded length -#> 20 Frank 16.0 16.5 16.4 Expanded length

    +#> 20 Frank 16.0 16.5 16.4 Expanded length
    # some need expansion but include NAs for upper values -( d2b <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), - lwr.bin=c(15, 15.5,16 ,16 ,17.1,17.3), - upr.bin=c(NA ,NA ,16.5,16.5,17.1,17.3), - freq=c(6,4,2,3,1,1)) )
    #> name lwr.bin upr.bin freq +( d2b <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), + lwr.bin=c(15, 15.5,16 ,16 ,17.1,17.3), + upr.bin=c(NA ,NA ,16.5,16.5,17.1,17.3), + freq=c(6,4,2,3,1,1)) ) +
    #> name lwr.bin upr.bin freq #> 1 Johnson 15.0 NA 6 #> 2 Johnson 15.5 NA 4 #> 3 Jones 16.0 16.5 2 #> 4 Frank 16.0 16.5 3 #> 5 Frank 17.1 17.1 1 -#> 6 Max 17.3 17.3 1
    expandCounts(d2b,~freq,~lwr.bin+upr.bin)
    #> Results messages from expandCounts(): +#> 6 Max 17.3 17.3 1
    expandCounts(d2b,~freq,~lwr.bin+upr.bin) +
    #> Results messages from expandCounts(): #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin newlen lennote #> 1 Frank 17.1 17.1 17.1 Observed length @@ -456,18 +475,20 @@

    Examp #> 14 Jones 16.0 16.5 16.1 Expanded length #> 15 Frank 16.0 16.5 16.1 Expanded length #> 16 Frank 16.0 16.5 16.3 Expanded length -#> 17 Frank 16.0 16.5 16.1 Expanded length

    +#> 17 Frank 16.0 16.5 16.1 Expanded length
    # some need expansion but include NAs for upper values -( d2c <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), - lwr.bin=c(NA,NA, 16 ,16 ,17.1,17.3), - upr.bin=c(15,15.5,16.5,16.5,17.1,17.3), - freq=c(6,4,2,3,1,1)) )
    #> name lwr.bin upr.bin freq +( d2c <- data.frame(name=c("Johnson","Johnson","Jones","Frank","Frank","Max"), + lwr.bin=c(NA,NA, 16 ,16 ,17.1,17.3), + upr.bin=c(15,15.5,16.5,16.5,17.1,17.3), + freq=c(6,4,2,3,1,1)) ) +
    #> name lwr.bin upr.bin freq #> 1 Johnson NA 15.0 6 #> 2 Johnson NA 15.5 4 #> 3 Jones 16.0 16.5 2 #> 4 Frank 16.0 16.5 3 #> 5 Frank 17.1 17.1 1 -#> 6 Max 17.3 17.3 1
    expandCounts(d2c,~freq,~lwr.bin+upr.bin)
    #> Results messages from expandCounts(): +#> 6 Max 17.3 17.3 1
    expandCounts(d2c,~freq,~lwr.bin+upr.bin) +
    #> Results messages from expandCounts(): #> 2 rows had an individual measurement. #> 4 rows with multiple measurements were expanded to 15 rows of individual measurements.
    #> name lwr.bin upr.bin newlen lennote #> 1 Frank 17.1 17.1 17.1 Observed length @@ -487,27 +508,29 @@

    Examp #> 15 Frank 16.0 16.5 16.2 Expanded length #> 16 Frank 16.0 16.5 16.5 Expanded length #> 17 Frank 16.0 16.5 16.5 Expanded length

    -if (FALSE) { +if (FALSE) { ##!!##!!## Change path to where example file is and then run to demo ## Read in datafile (note periods in names) -df <- read.csv("c:/aaawork/consulting/R_WiDNR/Statewide/Surveysummaries2010.csv") -str(df) +df <- read.csv("c:/aaawork/consulting/R_WiDNR/Statewide/Surveysummaries2010.csv") +str(df) ## narrow variables for simplicity -df1 <- df[,c("County","Waterbody.Name","Survey.Year","Gear","Species", +df1 <- df[,c("County","Waterbody.Name","Survey.Year","Gear","Species", "Number.of.Fish","Length.or.Lower.Length.IN","Length.Upper.IN", - "Weight.Pounds","Gender")] + "Weight.Pounds","Gender")] ## Sum the count to see how many fish there should be after expansion -sum(df1$Number.of.Fish) +sum(df1$Number.of.Fish) ## Simple expansion -df2 <- expandCounts(df1,~Number.of.Fish) +df2 <- expandCounts(df1,~Number.of.Fish) ## Same expansion but include random component to lengths (thus new variable) ## also note default lprec=0.1 -df3 <- expandCounts(df1,~Number.of.Fish,~Length.or.Lower.Length.IN+Length.Upper.IN) +df3 <- expandCounts(df1,~Number.of.Fish,~Length.or.Lower.Length.IN+Length.Upper.IN) + +} -}
    +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/expandLenFreq.html b/docs/reference/expandLenFreq.html index d23d2f52..bde21af5 100644 --- a/docs/reference/expandLenFreq.html +++ b/docs/reference/expandLenFreq.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,16 +128,16 @@

    Expands a length frequency based on a subsample.

    Creates a vector of lengths for the individuals not measured based on the lengths measured in a subsample of individuals.

    -
    expandLenFreq(
    -  x,
    -  w,
    -  additional,
    -  startcat = NULL,
    -  total = additional + length(x),
    -  decimals = decs$wdec,
    -  show.summary = TRUE,
    -  ...
    -)
    +
    expandLenFreq(
    +  x,
    +  w,
    +  additional,
    +  startcat = NULL,
    +  total = additional + length(x),
    +  decimals = decs$wdec,
    +  show.summary = TRUE,
    +  ...
    +)

    Arguments

    @@ -187,16 +187,20 @@

    Details

    See also

    See expandCounts for expanding more than just lengths or expanding lengths when there is a known number in each length bin. See lencat for creating length bins.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Set the random seed for reproducibility -set.seed(15343437) +set.seed(15343437) ## First example # random lengths measured to nearest 0.1 unit -- values in a vector -len1 <- round(runif(50,0.1,9.9),1) +len1 <- round(runif(50,0.1,9.9),1) # assignment of integer lengths to 110 non-measured individuals -new.len1a <- expandLenFreq(len1,w=1,total=160)
    #> Length Frequency Expansion using: +new.len1a <- expandLenFreq(len1,w=1,total=160) +
    #> Length Frequency Expansion using: #> Measured length frequency of 50 individuals: #> 0 1 2 3 4 5 6 7 8 9 #> 0.08 0.06 0.04 0.08 0.14 0.10 0.14 0.04 0.16 0.16 @@ -207,10 +211,12 @@

    Examp #> Random allocations of 5 individuals #> With final length frequency table of: #> 0 1 2 3 4 5 6 7 8 9 -#> 8 6 4 8 17 11 15 4 20 17

    new.len1a
    #> [1] 0 0 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 +#> 8 6 4 8 17 11 15 4 20 17
    new.len1a +
    #> [1] 0 0 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 #> [38] 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 8 #> [75] 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
    # assignment of lengths to 0.1 to 110 non-measured individuals -new.len1b <- expandLenFreq(len1,w=1,total=160,decimals=1)
    #> Length Frequency Expansion using: +new.len1b <- expandLenFreq(len1,w=1,total=160,decimals=1) +
    #> Length Frequency Expansion using: #> Measured length frequency of 50 individuals: #> 0 1 2 3 4 5 6 7 8 9 #> 0.08 0.06 0.04 0.08 0.14 0.10 0.14 0.04 0.16 0.16 @@ -221,7 +227,8 @@

    Examp #> Random allocations of 5 individuals #> With final length frequency table of: #> 0 1 2 3 4 5 6 7 8 9 -#> 8 6 5 8 16 11 16 4 19 17

    new.len1b
    #> [1] 0.1 0.1 0.2 0.3 0.3 0.3 0.5 0.9 1.3 1.4 1.5 1.5 1.6 1.6 2.1 2.1 2.3 2.6 +#> 8 6 5 8 16 11 16 4 19 17
    new.len1b +
    #> [1] 0.1 0.1 0.2 0.3 0.3 0.3 0.5 0.9 1.3 1.4 1.5 1.5 1.6 1.6 2.1 2.1 2.3 2.6 #> [19] 2.8 3.0 3.1 3.3 3.5 3.5 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.3 4.4 4.4 4.5 4.6 #> [37] 4.7 4.8 4.8 4.8 4.8 4.8 4.9 5.0 5.1 5.3 5.4 5.6 5.6 5.8 5.8 5.8 5.8 5.9 #> [55] 6.0 6.1 6.2 6.4 6.5 6.6 6.6 6.6 6.6 6.6 6.7 6.8 6.8 6.8 6.9 6.9 7.4 7.5 @@ -230,9 +237,10 @@

    Examp #> [109] 9.8 9.8

    ## Second example -- if values are in a data.frame # random lengths measured to nearest 0.1 unit -len2 <- data.frame(len=round(runif(50,10,117),1)) +len2 <- data.frame(len=round(runif(50,10,117),1)) # assignment of lengths to 0.1 for 140 non-measured indivs -new.len2a <- expandLenFreq(len2$len,w=10,total=190,decimals=1)
    #> Length Frequency Expansion using: +new.len2a <- expandLenFreq(len2$len,w=10,total=190,decimals=1) +
    #> Length Frequency Expansion using: #> Measured length frequency of 50 individuals: #> 10 20 30 40 50 60 70 80 90 100 110 #> 0.06 0.06 0.06 0.14 0.04 0.10 0.12 0.14 0.12 0.04 0.12 @@ -243,7 +251,8 @@

    Examp #> Random allocations of 6 individuals #> With final length frequency table of: #> 10 20 30 40 50 60 70 80 90 100 110 -#> 8 8 8 20 6 15 18 20 16 5 16

    new.len2a
    #> [1] 10.1 10.7 12.2 15.9 16.2 16.3 17.8 18.2 24.2 25.0 25.4 25.6 +#> 8 8 8 20 6 15 18 20 16 5 16
    new.len2a +
    #> [1] 10.1 10.7 12.2 15.9 16.2 16.3 17.8 18.2 24.2 25.0 25.4 25.6 #> [13] 27.0 27.5 29.1 29.9 31.2 31.9 31.9 32.9 33.5 36.0 38.0 38.6 #> [25] 41.0 41.8 42.5 42.7 42.7 42.8 43.1 43.3 43.4 44.0 44.2 44.2 #> [37] 44.9 45.1 47.3 47.5 49.1 49.1 49.6 49.6 51.9 52.1 55.4 56.6 @@ -257,9 +266,10 @@

    Examp #> [133] 114.1 114.5 115.2 116.8 117.1 118.6 119.3 119.7

    ## Third example # hypothetically measured lengths -len <- c(6.7,6.9,7.3,7.4,7.5,8.2,8.7,8.9) +len <- c(6.7,6.9,7.3,7.4,7.5,8.2,8.7,8.9) # find lengths for unmeasured fish assuming a total of 30 -newlen1 <- expandLenFreq(len,w=0.5,total=30,decimals=1)
    #> Length Frequency Expansion using: +newlen1 <- expandLenFreq(len,w=0.5,total=30,decimals=1) +
    #> Length Frequency Expansion using: #> Measured length frequency of 8 individuals: #> 6.5 7 7.5 8 8.5 #> 0.250 0.250 0.125 0.125 0.250 @@ -270,9 +280,11 @@

    Examp #> Random allocations of 3 individuals #> With final length frequency table of: #> 6.5 7 7.5 8 8.5 -#> 6 5 2 4 5

    newlen1
    #> [1] 6.6 6.7 6.7 6.7 6.8 6.9 7.1 7.1 7.2 7.3 7.3 7.5 7.7 8.0 8.2 8.3 8.3 8.5 8.6 +#> 6 5 2 4 5
    newlen1 +
    #> [1] 6.6 6.7 6.7 6.7 6.8 6.9 7.1 7.1 7.2 7.3 7.3 7.5 7.7 8.0 8.2 8.3 8.3 8.5 8.6 #> [20] 8.7 8.8 8.8
    # set a starting length category -newlen2 <- expandLenFreq(len,w=0.5,startcat=6.2,total=30,decimals=1)
    #> Length Frequency Expansion using: +newlen2 <- expandLenFreq(len,w=0.5,startcat=6.2,total=30,decimals=1) +
    #> Length Frequency Expansion using: #> Measured length frequency of 8 individuals: #> 6.7 7.2 8.2 8.7 #> 0.250 0.375 0.125 0.250 @@ -283,7 +295,8 @@

    Examp #> Random allocations of 2 individuals #> With final length frequency table of: #> 6.7 7.2 8.2 8.7 -#> 6 9 2 5

    newlen2
    #> [1] 6.7 6.7 6.9 6.9 6.9 6.9 7.2 7.3 7.3 7.3 7.4 7.4 7.4 7.6 7.6 8.4 8.5 8.7 8.8 +#> 6 9 2 5
    newlen2 +
    #> [1] 6.7 6.7 6.9 6.9 6.9 6.9 7.2 7.3 7.3 7.3 7.4 7.4 7.4 7.6 7.6 8.4 8.5 8.7 8.8 #> [20] 9.0 9.0 9.1
    @@ -301,7 +314,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/extraTests.html b/docs/reference/extraTests.html index 712d5cfa..3566e5ce 100644 --- a/docs/reference/extraTests.html +++ b/docs/reference/extraTests.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,12 +128,12 @@

    Likelihood ratio and extra sum-of-squares tests.

    Likelihood ratio and extra sum-of-squares tests with multiple lm or nls models nested within one common model. This function is most useful when the nested functions are all at the same level; otherwise use anova() or lrtest() which are more flexible.

    -
    lrt(sim, ..., com, sim.names = sim.name, sim.name = NULL, com.name = NULL)
    +    
    lrt(sim, ..., com, sim.names = sim.name, sim.name = NULL, com.name = NULL)
     
    -extraSS(sim, ..., com, sim.names = sim.name, sim.name = NULL, com.name = NULL)
    +extraSS(sim, ..., com, sim.names = sim.name, sim.name = NULL, com.name = NULL)
     
     # S3 method for extraTest
    -print(x, ...)
    +print(x, ...)

    Arguments

    @@ -183,21 +183,25 @@

    Details

    Note

    This function is experimental at this point. It seems to work fine for lm and nls models. An error will be thrown by extraSS for other model classes, but lrt will not (but it has not been thoroughly tests for other models).

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Example data -df <- data.frame(x=c(1,2,3,4,5,6,7,8,9,10), - y=c(4,6,5,7,9,8,7,12,16,22), - z=as.factor(rep(c("A","B"),each=5)), - w=as.factor(rep(c("A","B"),times=5))) -df$x2 <- df$x^2 +df <- data.frame(x=c(1,2,3,4,5,6,7,8,9,10), + y=c(4,6,5,7,9,8,7,12,16,22), + z=as.factor(rep(c("A","B"),each=5)), + w=as.factor(rep(c("A","B"),times=5))) +df$x2 <- df$x^2 ## Linear (lm()) models # ... regression -fit.0 <- lm(y~1,data=df) -fit.1 <- lm(y~x,data=df) -fit.2 <- lm(y~x2+x,data=df) -extraSS(fit.0,fit.1,com=fit.2)
    #> Model 1: y ~ 1 +fit.0 <- lm(y~1,data=df) +fit.1 <- lm(y~x,data=df) +fit.2 <- lm(y~x2+x,data=df) +extraSS(fit.0,fit.1,com=fit.2) +
    #> Model 1: y ~ 1 #> Model 2: y ~ x #> Model A: y ~ x2 + x #> @@ -205,7 +209,8 @@

    Examp #> 1vA 9 282.400 7 27.617 2 254.783 32.290 0.0002925 *** #> 2vA 8 67.988 7 27.617 1 40.371 10.233 0.0150891 * #> --- -#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    lrt(fit.0,fit.1,com=fit.2)
    #> Loading required namespace: lmtest
    #> Model 1: y ~ 1 +#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
    lrt(fit.0,fit.1,com=fit.2) +
    #> Loading required namespace: lmtest
    #> Model 1: y ~ 1 #> Model 2: y ~ x #> Model A: y ~ x2 + x #> @@ -215,8 +220,9 @@

    Examp #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    # ... show labels for models -extraSS(fit.0,fit.1,com=fit.2, - sim.names=c("Null Model","Linear"),com.name="Quadratic")
    #> Model 1: Null Model +extraSS(fit.0,fit.1,com=fit.2, + sim.names=c("Null Model","Linear"),com.name="Quadratic") +
    #> Model 1: Null Model #> Model 2: Linear #> Model A: Quadratic #> @@ -224,8 +230,9 @@

    Examp #> 1vA 9 282.400 7 27.617 2 254.783 32.290 0.0002925 *** #> 2vA 8 67.988 7 27.617 1 40.371 10.233 0.0150891 * #> --- -#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    lrt(fit.0,fit.1,com=fit.2, - sim.names=c("Null Model","Linear"),com.name="Quadratic")
    #> Model 1: Null Model +#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
    lrt(fit.0,fit.1,com=fit.2, + sim.names=c("Null Model","Linear"),com.name="Quadratic") +
    #> Model 1: Null Model #> Model 2: Linear #> Model A: Quadratic #> @@ -235,8 +242,9 @@

    Examp #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    # ... dummy variable regression -fit.2b <- lm(y~x*z,data=df) -extraSS(fit.0,fit.1,com=fit.2b)
    #> Model 1: y ~ 1 +fit.2b <- lm(y~x*z,data=df) +extraSS(fit.0,fit.1,com=fit.2b) +
    #> Model 1: y ~ 1 #> Model 2: y ~ x #> Model A: y ~ x * z #> @@ -244,7 +252,8 @@

    Examp #> 1vA 9 282.400 6 17.800 3 264.600 29.7303 0.0005347 *** #> 2vA 8 67.988 6 17.800 2 50.188 8.4586 0.0179459 * #> --- -#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    lrt(fit.0,fit.1,com=fit.2b)
    #> Model 1: y ~ 1 +#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
    lrt(fit.0,fit.1,com=fit.2b) +
    #> Model 1: y ~ 1 #> Model 2: y ~ x #> Model A: y ~ x * z #> @@ -254,15 +263,17 @@

    Examp #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    # ... ANOVAs -fit.1 <- lm(y~w,data=df) -fit.2 <- lm(y~w*z,data=df) -extraSS(fit.0,fit.1,com=fit.2)
    #> Model 1: y ~ 1 +fit.1 <- lm(y~w,data=df) +fit.2 <- lm(y~w*z,data=df) +extraSS(fit.0,fit.1,com=fit.2) +
    #> Model 1: y ~ 1 #> Model 2: y ~ w #> Model A: y ~ w * z #> #> DfO RSSO DfA RSSA Df SS F Pr(>F) #> 1vA 9 282.4 6 159.0 3 123.4 1.5522 0.2955 -#> 2vA 8 262.8 6 159.0 2 103.8 1.9585 0.2215
    lrt(fit.0,fit.1,com=fit.2)
    #> Model 1: y ~ 1 +#> 2vA 8 262.8 6 159.0 2 103.8 1.9585 0.2215
    lrt(fit.0,fit.1,com=fit.2) +
    #> Model 1: y ~ 1 #> Model 2: y ~ w #> Model A: y ~ w * z #> @@ -273,10 +284,11 @@

    Examp #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    ## Non-linear (nls()) models -fit.0 = nls(y~c,data=df,start=list(c=10)) -fit.1 = nls(y~a*x+c,data=df,start=list(a=1,c=1)) -fit.2 = nls(y~b*x2+a*x+c,data=df,start=list(a=-1,b=0.3,c=10)) -extraSS(fit.0,fit.1,com=fit.2)
    #> Model 1: y ~ c +fit.0 = nls(y~c,data=df,start=list(c=10)) +fit.1 = nls(y~a*x+c,data=df,start=list(a=1,c=1)) +fit.2 = nls(y~b*x2+a*x+c,data=df,start=list(a=-1,b=0.3,c=10)) +extraSS(fit.0,fit.1,com=fit.2) +
    #> Model 1: y ~ c #> Model 2: y ~ a * x + c #> Model A: y ~ b * x2 + a * x + c #> @@ -284,7 +296,8 @@

    Examp #> 1vA 9 282.400 7 27.617 2 254.783 32.290 0.0002925 *** #> 2vA 8 67.988 7 27.617 1 40.371 10.233 0.0150891 * #> --- -#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    lrt(fit.0,fit.1,com=fit.2)
    #> Model 1: y ~ c +#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
    lrt(fit.0,fit.1,com=fit.2) +
    #> Model 1: y ~ c #> Model 2: y ~ a * x + c #> Model A: y ~ b * x2 + a * x + c #> @@ -294,15 +307,17 @@

    Examp #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    ## General least-squares (gls()) models -if (FALSE) { - require(nlme) - fit.0 <- gls(y~1,data=df,method="ML") - fit.1 <- gls(y~x,data=df,method="ML") - fit.2 <- gls(y~x2+x,data=df,method="ML") - lrt(fit.0,fit.1, com=fit.2) +if (FALSE) { + require(nlme) + fit.0 <- gls(y~1,data=df,method="ML") + fit.1 <- gls(y~x,data=df,method="ML") + fit.2 <- gls(y~x2+x,data=df,method="ML") + lrt(fit.0,fit.1, com=fit.2) ## will return an error ... does not work with gls() models # extraSS(fit.0,fit.1, com=fit.2) -}
    +} + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/fact2num.html b/docs/reference/fact2num.html index cd92aba4..96352cd2 100644 --- a/docs/reference/fact2num.html +++ b/docs/reference/fact2num.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Converts "numeric" factor levels to numeric values.

    Converts “numeric” factor levels to numeric values.

    -
    fact2num(object)
    +
    fact2num(object)

    Arguments

    @@ -142,19 +142,26 @@

    Arg

    Value

    A numeric vector.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    junk <- factor(c(1,7,2,4,3,10)) -str(junk)
    #> Factor w/ 6 levels "1","2","3","4",..: 1 5 2 4 3 6
    junk2 <- fact2num(junk) -str(junk2)
    #> num [1:6] 1 7 2 4 3 10
    +
    junk <- factor(c(1,7,2,4,3,10)) +str(junk) +
    #> Factor w/ 6 levels "1","2","3","4",..: 1 5 2 4 3 6
    junk2 <- fact2num(junk) +str(junk2) +
    #> num [1:6] 1 7 2 4 3 10
    ## ONLY RUN IN INTERACTIVE MODE -if (interactive()) { +if (interactive()) { -bad <- factor(c("A","B","C")) +bad <- factor(c("A","B","C")) # This will result in an error -- levels are not 'numeric' -bad2 <- fact2num(bad) +bad2 <- fact2num(bad) + +} ## END IF INTERACTIVE MODE -} ## END IF INTERACTIVE MODE
    +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/fishR.html b/docs/reference/fishR.html index 290a89d2..e364b02e 100644 --- a/docs/reference/fishR.html +++ b/docs/reference/fishR.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,10 +128,10 @@

    Opens web pages associated with the fishR website.

    Opens web pages associated with the fishR website in a browser. The user can open the main page or choose a specific page to open.

    -
    fishR(
    -  where = c("home", "IFAR", "general", "books", "AIFFD", "posts", "news"),
    -  open = TRUE
    -)
    +
    fishR(
    +  where = c("home", "IFAR", "general", "books", "AIFFD", "posts", "news"),
    +  open = TRUE
    +)

    Arguments

    @@ -149,17 +149,22 @@

    Arg

    Value

    None, but a webpage will be opened in the default browser.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    if (FALSE) { +
    if (FALSE) { ## Opens an external webpage ... only run interactively -fishR() # home page -fishR("IFAR") # Introduction to Fisheries Analysis with R page -fishR("general") # examples page -fishR("books") # examples page -fishR("AIFFD") # Analysis & Interpretation of Freshw. Fisher. Data page -fishR("posts") # blog posts (some examples) page -}
    +fishR() # home page +fishR("IFAR") # Introduction to Fisheries Analysis with R page +fishR("general") # examples page +fishR("books") # examples page +fishR("AIFFD") # Analysis & Interpretation of Freshw. Fisher. Data page +fishR("posts") # blog posts (some examples) page +} + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/fitPlot-1.png b/docs/reference/fitPlot-1.png index bda857c4..46a0c4fe 100644 Binary files a/docs/reference/fitPlot-1.png and b/docs/reference/fitPlot-1.png differ diff --git a/docs/reference/fitPlot-10.png b/docs/reference/fitPlot-10.png index 7a277f17..a2d72adf 100644 Binary files a/docs/reference/fitPlot-10.png and b/docs/reference/fitPlot-10.png differ diff --git a/docs/reference/fitPlot-11.png b/docs/reference/fitPlot-11.png index 10512d85..9f4ae5b1 100644 Binary files a/docs/reference/fitPlot-11.png and b/docs/reference/fitPlot-11.png differ diff --git a/docs/reference/fitPlot-12.png b/docs/reference/fitPlot-12.png index 7a7be558..8c09abf8 100644 Binary files a/docs/reference/fitPlot-12.png and b/docs/reference/fitPlot-12.png differ diff --git a/docs/reference/fitPlot-13.png b/docs/reference/fitPlot-13.png index 5de91964..a60aea44 100644 Binary files a/docs/reference/fitPlot-13.png and b/docs/reference/fitPlot-13.png differ diff --git a/docs/reference/fitPlot-14.png b/docs/reference/fitPlot-14.png index a80df5fd..6f8e2854 100644 Binary files a/docs/reference/fitPlot-14.png and b/docs/reference/fitPlot-14.png differ diff --git a/docs/reference/fitPlot-15.png b/docs/reference/fitPlot-15.png index 3a7b418e..2c1848b2 100644 Binary files a/docs/reference/fitPlot-15.png and b/docs/reference/fitPlot-15.png differ diff --git a/docs/reference/fitPlot-16.png b/docs/reference/fitPlot-16.png index 55a4ab51..0a39e8bc 100644 Binary files a/docs/reference/fitPlot-16.png and b/docs/reference/fitPlot-16.png differ diff --git a/docs/reference/fitPlot-17.png b/docs/reference/fitPlot-17.png index 7b06708e..d2e18986 100644 Binary files a/docs/reference/fitPlot-17.png and b/docs/reference/fitPlot-17.png differ diff --git a/docs/reference/fitPlot-18.png b/docs/reference/fitPlot-18.png index bca07e74..ac3a2b58 100644 Binary files a/docs/reference/fitPlot-18.png and b/docs/reference/fitPlot-18.png differ diff --git a/docs/reference/fitPlot-19.png b/docs/reference/fitPlot-19.png index fa0b66fb..1df925f6 100644 Binary files a/docs/reference/fitPlot-19.png and b/docs/reference/fitPlot-19.png differ diff --git a/docs/reference/fitPlot-2.png b/docs/reference/fitPlot-2.png index 53ef4a0e..b5501576 100644 Binary files a/docs/reference/fitPlot-2.png and b/docs/reference/fitPlot-2.png differ diff --git a/docs/reference/fitPlot-20.png b/docs/reference/fitPlot-20.png index 08ba233e..1f3a2a84 100644 Binary files a/docs/reference/fitPlot-20.png and b/docs/reference/fitPlot-20.png differ diff --git a/docs/reference/fitPlot-21.png b/docs/reference/fitPlot-21.png index 52c1f231..a08f349e 100644 Binary files a/docs/reference/fitPlot-21.png and b/docs/reference/fitPlot-21.png differ diff --git a/docs/reference/fitPlot-22.png b/docs/reference/fitPlot-22.png index 3a7b418e..a751749a 100644 Binary files a/docs/reference/fitPlot-22.png and b/docs/reference/fitPlot-22.png differ diff --git a/docs/reference/fitPlot-23.png b/docs/reference/fitPlot-23.png index 30428f9f..9a696b04 100644 Binary files a/docs/reference/fitPlot-23.png and b/docs/reference/fitPlot-23.png differ diff --git a/docs/reference/fitPlot-24.png b/docs/reference/fitPlot-24.png index 4e58ecff..71bb0e00 100644 Binary files a/docs/reference/fitPlot-24.png and b/docs/reference/fitPlot-24.png differ diff --git a/docs/reference/fitPlot-25.png b/docs/reference/fitPlot-25.png index 743262f4..0a0913b9 100644 Binary files a/docs/reference/fitPlot-25.png and b/docs/reference/fitPlot-25.png differ diff --git a/docs/reference/fitPlot-26.png b/docs/reference/fitPlot-26.png index 871f34c7..1acbe64f 100644 Binary files a/docs/reference/fitPlot-26.png and b/docs/reference/fitPlot-26.png differ diff --git a/docs/reference/fitPlot-27.png b/docs/reference/fitPlot-27.png index 055ef1c5..fe4bb840 100644 Binary files a/docs/reference/fitPlot-27.png and b/docs/reference/fitPlot-27.png differ diff --git a/docs/reference/fitPlot-3.png b/docs/reference/fitPlot-3.png index bda857c4..4df94576 100644 Binary files a/docs/reference/fitPlot-3.png and b/docs/reference/fitPlot-3.png differ diff --git a/docs/reference/fitPlot-4.png b/docs/reference/fitPlot-4.png index bda857c4..015f7e2d 100644 Binary files a/docs/reference/fitPlot-4.png and b/docs/reference/fitPlot-4.png differ diff --git a/docs/reference/fitPlot-5.png b/docs/reference/fitPlot-5.png index a00c2d83..327af6cf 100644 Binary files a/docs/reference/fitPlot-5.png and b/docs/reference/fitPlot-5.png differ diff --git a/docs/reference/fitPlot-6.png b/docs/reference/fitPlot-6.png index 2c7551c0..1a41883d 100644 Binary files a/docs/reference/fitPlot-6.png and b/docs/reference/fitPlot-6.png differ diff --git a/docs/reference/fitPlot-7.png b/docs/reference/fitPlot-7.png index 6bb39f12..b0fc57fb 100644 Binary files a/docs/reference/fitPlot-7.png and b/docs/reference/fitPlot-7.png differ diff --git a/docs/reference/fitPlot-8.png b/docs/reference/fitPlot-8.png index 8672c29b..e95bff04 100644 Binary files a/docs/reference/fitPlot-8.png and b/docs/reference/fitPlot-8.png differ diff --git a/docs/reference/fitPlot-9.png b/docs/reference/fitPlot-9.png index 25bbe3f1..e5b9f0aa 100644 Binary files a/docs/reference/fitPlot-9.png and b/docs/reference/fitPlot-9.png differ diff --git a/docs/reference/fitPlot.html b/docs/reference/fitPlot.html index 8caa0e41..8d290d1d 100644 --- a/docs/reference/fitPlot.html +++ b/docs/reference/fitPlot.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,124 +128,124 @@

    Fitted model plot for an lm, glm, or nls object.

    A generic function for constructing a fitted model plot for an lm, glm, or nls object. Supported objects are linear models from simple linear regression (SLR), indicator variable regression (IVR), one-way ANOVA, or two-way ANOVA models; general linear models that are logistic regressions with a binary response; and non-linear regression with a single numerical response variable, at least one continuous explanatory variable and up to two group-factor explanatory variables.

    -
    fitPlot(object, ...)
    +    
    fitPlot(object, ...)
     
     # S3 method for lm
    -fitPlot(object, ...)
    +fitPlot(object, ...)
     
     # S3 method for SLR
    -fitPlot(
    -  object,
    -  plot.pts = TRUE,
    -  pch = 16,
    -  col.pt = "black",
    -  col.mdl = "red",
    -  lwd = 3,
    -  lty = 1,
    -  interval = c("none", "confidence", "prediction", "both"),
    -  conf.level = 0.95,
    -  lty.ci = 2,
    -  lty.pi = 3,
    -  xlab = object$Enames[1],
    -  ylab = object$Rname,
    -  main = "",
    -  ylim = NULL,
    -  ...
    -)
    +fitPlot(
    +  object,
    +  plot.pts = TRUE,
    +  pch = 16,
    +  col.pt = "black",
    +  col.mdl = "red",
    +  lwd = 3,
    +  lty = 1,
    +  interval = c("none", "confidence", "prediction", "both"),
    +  conf.level = 0.95,
    +  lty.ci = 2,
    +  lty.pi = 3,
    +  xlab = object$Enames[1],
    +  ylab = object$Rname,
    +  main = "",
    +  ylim = NULL,
    +  ...
    +)
     
     # S3 method for IVR
    -fitPlot(object, ...)
    +fitPlot(object, ...)
     
     # S3 method for POLY
    -fitPlot(object, ...)
    +fitPlot(object, ...)
     
     # S3 method for ONEWAY
    -fitPlot(
    -  object,
    -  xlab = object$Enames[1],
    -  ylab = object$Rname,
    -  main = "",
    -  type = "b",
    -  pch = 16,
    -  lty = 1,
    -  col = "black",
    -  interval = TRUE,
    -  conf.level = 0.95,
    -  ci.fun = iCIfp(conf.level),
    -  col.ci = col,
    -  lty.ci = 1,
    -  ...
    -)
    +fitPlot(
    +  object,
    +  xlab = object$Enames[1],
    +  ylab = object$Rname,
    +  main = "",
    +  type = "b",
    +  pch = 16,
    +  lty = 1,
    +  col = "black",
    +  interval = TRUE,
    +  conf.level = 0.95,
    +  ci.fun = iCIfp(conf.level),
    +  col.ci = col,
    +  lty.ci = 1,
    +  ...
    +)
     
     # S3 method for TWOWAY
    -fitPlot(
    -  object,
    -  which,
    -  change.order = FALSE,
    -  xlab = object$Enames[ord[1]],
    -  ylab = object$Rname,
    -  main = "",
    -  type = "b",
    -  pch = c(16, 21, 15, 22, 17, 24, c(3:14)),
    -  lty = c(1:6, 1:6, 1:6),
    -  col = "default",
    -  interval = TRUE,
    -  conf.level = 0.95,
    -  ci.fun = iCIfp(conf.level),
    -  lty.ci = 1,
    -  legend = "topright",
    -  cex.leg = 1,
    -  box.lty.leg = 0,
    -  ...
    -)
    +fitPlot(
    +  object,
    +  which,
    +  change.order = FALSE,
    +  xlab = object$Enames[ord[1]],
    +  ylab = object$Rname,
    +  main = "",
    +  type = "b",
    +  pch = c(16, 21, 15, 22, 17, 24, c(3:14)),
    +  lty = c(1:6, 1:6, 1:6),
    +  col = "default",
    +  interval = TRUE,
    +  conf.level = 0.95,
    +  ci.fun = iCIfp(conf.level),
    +  lty.ci = 1,
    +  legend = "topright",
    +  cex.leg = 1,
    +  box.lty.leg = 0,
    +  ...
    +)
     
     # S3 method for nls
    -fitPlot(
    -  object,
    -  d,
    -  pch = c(19, 1),
    -  col.pt = c("black", "red"),
    -  col.mdl = col.pt,
    -  lwd = 2,
    -  lty = 1,
    -  plot.pts = TRUE,
    -  jittered = FALSE,
    -  ylim = NULL,
    -  legend = FALSE,
    -  legend.lbls = c("Group 1", "Group 2"),
    -  ylab = names(mdl$model)[1],
    -  xlab = names(mdl$model)[xpos],
    -  main = "",
    -  ...
    -)
    +fitPlot(
    +  object,
    +  d,
    +  pch = c(19, 1),
    +  col.pt = c("black", "red"),
    +  col.mdl = col.pt,
    +  lwd = 2,
    +  lty = 1,
    +  plot.pts = TRUE,
    +  jittered = FALSE,
    +  ylim = NULL,
    +  legend = FALSE,
    +  legend.lbls = c("Group 1", "Group 2"),
    +  ylab = names(mdl$model)[1],
    +  xlab = names(mdl$model)[xpos],
    +  main = "",
    +  ...
    +)
     
     # S3 method for glm
    -fitPlot(object, ...)
    +fitPlot(object, ...)
     
     # S3 method for logreg
    -fitPlot(
    -  object,
    -  xlab = names(object$model)[2],
    -  ylab = names(object$model)[1],
    -  main = "",
    -  plot.pts = TRUE,
    -  col.pt = "black",
    -  transparency = NULL,
    -  plot.p = TRUE,
    -  breaks = 25,
    -  p.col = "blue",
    -  p.pch = 3,
    -  p.cex = 1,
    -  yaxis1.ticks = seq(0, 1, 0.1),
    -  yaxis1.lbls = c(0, 0.5, 1),
    -  yaxis2.show = TRUE,
    -  col.mdl = "red",
    -  lwd = 2,
    -  lty = 1,
    -  mdl.vals = 50,
    -  xlim = range(x),
    -  ...
    -)
    +fitPlot( + object, + xlab = names(object$model)[2], + ylab = names(object$model)[1], + main = "", + plot.pts = TRUE, + col.pt = "black", + transparency = NULL, + plot.p = TRUE, + breaks = 25, + p.col = "blue", + p.pch = 3, + p.cex = 1, + yaxis1.ticks = seq(0, 1, 0.1), + yaxis1.lbls = c(0, 0.5, 1), + yaxis2.show = TRUE, + col.mdl = "red", + lwd = 2, + lty = 1, + mdl.vals = 50, + xlim = range(x), + ... +)

    Arguments

    @@ -422,58 +422,90 @@

    Note

    See also

    See abline, regLine in car, error.bars in psych, interaction.plot, and lineplot.CI in sciplot for similar functionality. See residPlot for related functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    # create year as a factor variable -Mirex$fyear <- factor(Mirex$year) +Mirex$fyear <- factor(Mirex$year) # reduce number of years for visual simplicity -Mirex2 <- filterD(Mirex,fyear %in% c(1977,1992)) +Mirex2 <- filterD(Mirex,fyear %in% c(1977,1992)) ## Indicator variable regression with two factors -lm1 <- lm(mirex~weight*fyear*species,data=Mirex2) -fitPlot(lm1)
    fitPlot(lm1,ylim=c(0,0.8),legend="topleft")
    +lm1 <- lm(mirex~weight*fyear*species,data=Mirex2) +fitPlot(lm1) +
    fitPlot(lm1,ylim=c(0,0.8),legend="topleft") +
    ## Indicator variable regression with two factors (but different orders) -lm1r <- lm(mirex~fyear*weight*species,data=Mirex2) -fitPlot(lm1r)
    lm1r2 <- lm(mirex~fyear*species*weight,data=Mirex2) -fitPlot(lm1r2)
    lm1r3 <- lm(mirex~species*fyear*weight,data=Mirex2) -fitPlot(lm1r3)
    +lm1r <- lm(mirex~fyear*weight*species,data=Mirex2) +fitPlot(lm1r) +
    lm1r2 <- lm(mirex~fyear*species*weight,data=Mirex2) +fitPlot(lm1r2) +
    lm1r3 <- lm(mirex~species*fyear*weight,data=Mirex2) +fitPlot(lm1r3) +
    ## Indicator variable regression with one factor (also showing confidence bands) -lm2 <- lm(mirex~weight*fyear,data=Mirex2) -fitPlot(lm2,legend="topleft")
    fitPlot(lm2,legend="topleft",interval="confidence")
    fitPlot(lm2,legend="topleft",col="rich",pch=18,lty=1)
    #> Warning: Your choices for 'col', 'pch', and 'lty' will make it difficult to see groups.
    +lm2 <- lm(mirex~weight*fyear,data=Mirex2) +fitPlot(lm2,legend="topleft") +
    fitPlot(lm2,legend="topleft",interval="confidence") +
    fitPlot(lm2,legend="topleft",col="rich",pch=18,lty=1) +
    #> Warning: Your choices for 'col', 'pch', and 'lty' will make it difficult to see groups.
    ## Indicator variable regression with one factor (as first variable) -lm2r <- lm(mirex~fyear*weight,data=Mirex2) -fitPlot(lm2r,legend="topleft",interval="both")
    +lm2r <- lm(mirex~fyear*weight,data=Mirex2) +fitPlot(lm2r,legend="topleft",interval="both") +
    ## Indicator variable regression with one factor (assuming parallel lines) -lm3 <- lm(mirex~weight+fyear,data=Mirex2) -fitPlot(lm3,legend="topleft")
    fitPlot(lm3,legend="topleft",col="default")
    +lm3 <- lm(mirex~weight+fyear,data=Mirex2) +fitPlot(lm3,legend="topleft") +
    fitPlot(lm3,legend="topleft",col="default") +
    ## Simple linear regression (showing color change and confidence and prediction bands) -lm4 <- lm(mirex~weight,data=Mirex) -fitPlot(lm4,pch=8,col.pt="red")
    fitPlot(lm4,col.mdl="blue")
    fitPlot(lm4,interval="both")
    +lm4 <- lm(mirex~weight,data=Mirex) +fitPlot(lm4,pch=8,col.pt="red") +
    fitPlot(lm4,col.mdl="blue") +
    fitPlot(lm4,interval="both") +
    ## One-way ANOVA -lm5 <- lm(mirex~fyear,data=Mirex) -fitPlot(lm5)
    fitPlot(lm5,col="red")
    fitPlot(lm5,col.ci="red")
    +lm5 <- lm(mirex~fyear,data=Mirex) +fitPlot(lm5) +
    fitPlot(lm5,col="red") +
    fitPlot(lm5,col.ci="red") +
    ## Two-way ANOVA -lm6 <- lm(mirex~fyear*species,data=Mirex) +lm6 <- lm(mirex~fyear*species,data=Mirex) # interaction plots and a color change -fitPlot(lm6,legend="bottomleft")
    fitPlot(lm6,change.order=TRUE)
    fitPlot(lm6,col="jet")
    # main effects plots -fitPlot(lm6,which="species")
    fitPlot(lm6,which="fyear")
    +fitPlot(lm6,legend="bottomleft") +
    fitPlot(lm6,change.order=TRUE) +
    fitPlot(lm6,col="jet") +
    # main effects plots +fitPlot(lm6,which="species") +
    fitPlot(lm6,which="fyear") +
    ## Polynomial regression -lm7 <- lm(mirex~weight+I(weight^2),data=Mirex) -fitPlot(lm7,interval="both")
    +lm7 <- lm(mirex~weight+I(weight^2),data=Mirex) +fitPlot(lm7,interval="both") +
    ## Non-linear model example -lr.sv <- list(B1=6,B2=7.2,B3=-1.5) -nl1 <- nls(cells~B1/(1+exp(B2+B3*days)),start=lr.sv,data=Ecoli) -fitPlot(nl1,Ecoli,cex.main=0.7,lwd=2)
    #> Error in nls(formula = cells ~ B1/(1 + exp(B2 + B3 * days)), data = Ecoli, start = lr.sv, algorithm = "default", control = list(maxiter = 50, tol = 1e-05, minFactor = 0.0009765625, printEval = FALSE, warnOnly = FALSE), trace = FALSE, model = TRUE): object 'lr.sv' not found
    fitPlot(nl1,Ecoli,xlab="Day",ylab="Cellsx10^6/ml",plot.pts=FALSE)
    #> Error in nls(formula = cells ~ B1/(1 + exp(B2 + B3 * days)), data = Ecoli, start = lr.sv, algorithm = "default", control = list(maxiter = 50, tol = 1e-05, minFactor = 0.0009765625, printEval = FALSE, warnOnly = FALSE), trace = FALSE, model = TRUE): object 'lr.sv' not found
    +lr.sv <- list(B1=6,B2=7.2,B3=-1.5) +nl1 <- nls(cells~B1/(1+exp(B2+B3*days)),start=lr.sv,data=Ecoli) +fitPlot(nl1,Ecoli,cex.main=0.7,lwd=2) +
    #> Error in nls(formula = cells ~ B1/(1 + exp(B2 + B3 * days)), data = Ecoli, start = lr.sv, algorithm = "default", control = list(maxiter = 50, tol = 1e-05, minFactor = 0.0009765625, printEval = FALSE, warnOnly = FALSE), trace = FALSE, model = TRUE): object 'lr.sv' not found
    fitPlot(nl1,Ecoli,xlab="Day",ylab="Cellsx10^6/ml",plot.pts=FALSE) +
    #> Error in nls(formula = cells ~ B1/(1 + exp(B2 + B3 * days)), data = Ecoli, start = lr.sv, algorithm = "default", control = list(maxiter = 50, tol = 1e-05, minFactor = 0.0009765625, printEval = FALSE, warnOnly = FALSE), trace = FALSE, model = TRUE): object 'lr.sv' not found
    ## Logistic regression example ## NASA space shuttle o-ring failures -- from graphics package -fail <- factor(c(2,2,2,2,1,1,1,1,1,1,2,1,2,1,1,1,1,2,1,1,1,1,1), -levels = 1:2, labels = c("no","yes")) -temperature <- c(53,57,58,63,66,67,67,67,68,69,70,70,70,70,72,73,75,75,76,76,78,79,81) -d <- data.frame(fail,temperature) -glm1 <- glm(fail~temperature,data=d,family="binomial") -fitPlot(glm1)
    fitPlot(glm1,breaks=seq(52,82,2))
    fitPlot(glm1,yaxis1.ticks=c(0,1),yaxis1.lbls=c(0,1))
    # changing the size of the y-axis labels -par(cex.axis=1.5,cex.lab=1.5) -fitPlot(glm1)
    +fail <- factor(c(2,2,2,2,1,1,1,1,1,1,2,1,2,1,1,1,1,2,1,1,1,1,1), +levels = 1:2, labels = c("no","yes")) +temperature <- c(53,57,58,63,66,67,67,67,68,69,70,70,70,70,72,73,75,75,76,76,78,79,81) +d <- data.frame(fail,temperature) +glm1 <- glm(fail~temperature,data=d,family="binomial") +fitPlot(glm1) +
    fitPlot(glm1,breaks=seq(52,82,2)) +
    fitPlot(glm1,yaxis1.ticks=c(0,1),yaxis1.lbls=c(0,1)) +
    # changing the size of the y-axis labels +par(cex.axis=1.5,cex.lab=1.5) +fitPlot(glm1) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/fsaNews.html b/docs/reference/fsaNews.html index e177b5c5..5f768250 100644 --- a/docs/reference/fsaNews.html +++ b/docs/reference/fsaNews.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,20 +128,25 @@

    Read news and changes for the 'FSA' package.

    Opens up the News.md GitHub file for the ‘FSA’ package in an external browser.

    -
    fsaNews()
    +    
    fsaNews()
     
    -FSANews()
    +FSANews()

    Value

    None.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    if (FALSE) { +
    if (FALSE) { ## Opens an external webpage ... only run interactively -FSANews() -}
    +FSANews() +} + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/geomean.html b/docs/reference/geomean.html index 861f05d7..19b60885 100644 --- a/docs/reference/geomean.html +++ b/docs/reference/geomean.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,9 +128,9 @@

    Calculates the geometric mean or geometric standard deviation.

    Calculates the geometric mean or standard deviation of a vector of numeric values.

    -
    geomean(x, na.rm = FALSE, zneg.rm = FALSE)
    +    
    geomean(x, na.rm = FALSE, zneg.rm = FALSE)
     
    -geosd(x, na.rm = FALSE, zneg.rm = FALSE)
    +geosd(x, na.rm = FALSE, zneg.rm = FALSE)

    Arguments

    @@ -161,22 +161,26 @@

    Note

    This function is largely an implementation of the code suggested by Russell Senior on R-help in November, 1999.

    See also

    -

    See geometric.mean in psych and Gmean for geometric mean calculators. See Gsd (documented with Gmean) from DescTools for geometric standard deviation calculators.

    +

    See geometric.mean in psych and Gmean for geometric mean calculators. See Gsd (documented with Gmean) from DescTools for geometric standard deviation calculators.

    Examples

    ## generate random lognormal data -d <- rlnorm(500,meanlog=0,sdlog=1) +d <- rlnorm(500,meanlog=0,sdlog=1) # d has a mean on log scale of 0; thus, gm should be exp(0)~=1 # d has a sd on log scale of 1; thus, gsd should be exp(1)~=2.7 -geomean(d)
    #> [1] 0.934946
    geosd(d)
    #> [1] 2.663484
    -if (FALSE) { +geomean(d) +
    #> [1] 0.934946
    geosd(d) +
    #> [1] 2.663484
    +if (FALSE) { ## Demonstrate handling of zeros and negative values -x <- seq(-1,5) +x <- seq(-1,5) # this will given an error -geomean(x) +geomean(x) # this will only give a warning, but might not be what you want -geomean(x,zneg.rm=TRUE) -}
    +geomean(x,zneg.rm=TRUE) +} + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/growthModels-1.png b/docs/reference/growthModels-1.png index 18f5e357..c039b53e 100644 Binary files a/docs/reference/growthModels-1.png and b/docs/reference/growthModels-1.png differ diff --git a/docs/reference/growthModels-10.png b/docs/reference/growthModels-10.png index 9f0c2a9b..bb994995 100644 Binary files a/docs/reference/growthModels-10.png and b/docs/reference/growthModels-10.png differ diff --git a/docs/reference/growthModels-11.png b/docs/reference/growthModels-11.png index 104011f6..18d3a1fe 100644 Binary files a/docs/reference/growthModels-11.png and b/docs/reference/growthModels-11.png differ diff --git a/docs/reference/growthModels-12.png b/docs/reference/growthModels-12.png index 6272b43a..4bb07a45 100644 Binary files a/docs/reference/growthModels-12.png and b/docs/reference/growthModels-12.png differ diff --git a/docs/reference/growthModels-13.png b/docs/reference/growthModels-13.png index 2c99eaa0..447ecf6b 100644 Binary files a/docs/reference/growthModels-13.png and b/docs/reference/growthModels-13.png differ diff --git a/docs/reference/growthModels-14.png b/docs/reference/growthModels-14.png index 05f3e056..01b886d9 100644 Binary files a/docs/reference/growthModels-14.png and b/docs/reference/growthModels-14.png differ diff --git a/docs/reference/growthModels-15.png b/docs/reference/growthModels-15.png index 18b3272c..c89156f1 100644 Binary files a/docs/reference/growthModels-15.png and b/docs/reference/growthModels-15.png differ diff --git a/docs/reference/growthModels-16.png b/docs/reference/growthModels-16.png index 719c2fec..0c637bf4 100644 Binary files a/docs/reference/growthModels-16.png and b/docs/reference/growthModels-16.png differ diff --git a/docs/reference/growthModels-17.png b/docs/reference/growthModels-17.png index bffe8bde..67d1ac33 100644 Binary files a/docs/reference/growthModels-17.png and b/docs/reference/growthModels-17.png differ diff --git a/docs/reference/growthModels-18.png b/docs/reference/growthModels-18.png index 5582528c..7fbcfbc9 100644 Binary files a/docs/reference/growthModels-18.png and b/docs/reference/growthModels-18.png differ diff --git a/docs/reference/growthModels-19.png b/docs/reference/growthModels-19.png index fc99283e..41611b84 100644 Binary files a/docs/reference/growthModels-19.png and b/docs/reference/growthModels-19.png differ diff --git a/docs/reference/growthModels-2.png b/docs/reference/growthModels-2.png index 4e3e0b5f..a90411b3 100644 Binary files a/docs/reference/growthModels-2.png and b/docs/reference/growthModels-2.png differ diff --git a/docs/reference/growthModels-20.png b/docs/reference/growthModels-20.png index e88942c7..4fcf9431 100644 Binary files a/docs/reference/growthModels-20.png and b/docs/reference/growthModels-20.png differ diff --git a/docs/reference/growthModels-3.png b/docs/reference/growthModels-3.png index 5d84a59a..10279cd0 100644 Binary files a/docs/reference/growthModels-3.png and b/docs/reference/growthModels-3.png differ diff --git a/docs/reference/growthModels-4.png b/docs/reference/growthModels-4.png index 14616fdb..7986d6f7 100644 Binary files a/docs/reference/growthModels-4.png and b/docs/reference/growthModels-4.png differ diff --git a/docs/reference/growthModels-5.png b/docs/reference/growthModels-5.png index 9136a836..7e182ff8 100644 Binary files a/docs/reference/growthModels-5.png and b/docs/reference/growthModels-5.png differ diff --git a/docs/reference/growthModels-6.png b/docs/reference/growthModels-6.png index eb00fa2e..99fd7c3d 100644 Binary files a/docs/reference/growthModels-6.png and b/docs/reference/growthModels-6.png differ diff --git a/docs/reference/growthModels-7.png b/docs/reference/growthModels-7.png index 2adb3c97..e0413e55 100644 Binary files a/docs/reference/growthModels-7.png and b/docs/reference/growthModels-7.png differ diff --git a/docs/reference/growthModels-8.png b/docs/reference/growthModels-8.png index fd455437..c4b7494c 100644 Binary files a/docs/reference/growthModels-8.png and b/docs/reference/growthModels-8.png differ diff --git a/docs/reference/growthModels-9.png b/docs/reference/growthModels-9.png index 67be2eb3..e854e699 100644 Binary files a/docs/reference/growthModels-9.png and b/docs/reference/growthModels-9.png differ diff --git a/docs/reference/growthModels.html b/docs/reference/growthModels.html index cdda8cf6..67b88d5f 100644 --- a/docs/reference/growthModels.html +++ b/docs/reference/growthModels.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,39 +128,39 @@

    Creates a function for a specific parameterization of the von Bertalanffy, G

    Creates a function for a specific parameterizations of the von Bertalanffy, Gompertz, Richards, and logistic growth functions. Use growthFunShow() to see the equations for each growth function.

    -
    vbFuns(
    -  param = c("Typical", "typical", "Traditional", "traditional", "BevertonHolt",
    +    
    vbFuns(
    +  param = c("Typical", "typical", "Traditional", "traditional", "BevertonHolt",
         "Original", "original", "vonBertalanffy", "GQ", "GallucciQuinn", "Mooij", "Weisberg",
         "Ogle", "Schnute", "Francis", "Laslett", "Polacheck", "Somers", "Somers2", "Pauly",
    -    "Fabens", "Fabens2", "Wang", "Wang2", "Wang3", "Francis2", "Francis3"),
    -  simple = FALSE,
    -  msg = FALSE
    -)
    +    "Fabens", "Fabens2", "Wang", "Wang2", "Wang3", "Francis2", "Francis3"),
    +  simple = FALSE,
    +  msg = FALSE
    +)
     
    -GompertzFuns(
    -  param = c("Ricker1", "Ricker2", "Ricker3", "QuinnDeriso1", "QuinnDeriso2",
    +GompertzFuns(
    +  param = c("Ricker1", "Ricker2", "Ricker3", "QuinnDeriso1", "QuinnDeriso2",
         "QuinnDeriso3", "QD1", "QD2", "QD3", "Original", "original", "Troynikov1",
    -    "Troynikov2"),
    -  simple = FALSE,
    -  msg = FALSE
    -)
    -
    -RichardsFuns(param = 1, simple = FALSE, msg = FALSE)
    -
    -logisticFuns(
    -  param = c("CJ1", "CJ2", "Karkach", "Haddon", "CampanaJones1", "CampanaJones2"),
    -  simple = FALSE,
    -  msg = FALSE
    -)
    -
    -growthFunShow(
    -  type = c("vonBertalanffy", "Gompertz", "Richards", "Logistic", "Schnute",
    -    "SchnuteRichards"),
    -  param = NULL,
    -  case = param,
    -  plot = FALSE,
    -  ...
    -)
    + "Troynikov2"), + simple = FALSE, + msg = FALSE +) + +RichardsFuns(param = 1, simple = FALSE, msg = FALSE) + +logisticFuns( + param = c("CJ1", "CJ2", "Karkach", "Haddon", "CampanaJones1", "CampanaJones2"), + simple = FALSE, + msg = FALSE +) + +growthFunShow( + type = c("vonBertalanffy", "Gompertz", "Richards", "Logistic", "Schnute", + "SchnuteRichards"), + param = NULL, + case = param, + plot = FALSE, + ... +)

    Arguments

    @@ -229,7 +229,7 @@

    <

    12-Individual Growth.

    References

    -

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

    +

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

    Campana, S.E. and C.M. Jones. 1992. Analysis of otolith microstructure data. Pages 73-100 In D.K. Stevenson and S.E. Campana, editors. Otolith microstructure examination and analysis. Canadian Special Publication of Fisheries and Aquatic Sciences 117. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/141734.pdf.]

    Fabens, A. 1965. Properties and fitting of the von Bertalanffy growth curve. Growth 29:265-289.

    Francis, R.I.C.C. 1988. Are growth parameters estimated from tagging and age-length data comparable? Canadian Journal of Fisheries and Aquatic Sciences, 45:936-942.

    @@ -257,146 +257,240 @@

    R

    See also

    See Schnute for an implementation of the Schnute (1981) model.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com, thanks to Gabor Grothendieck for a hint about using get().

    Examples

    ########################################################### ## Simple Examples -- Von B -( vb1 <- vbFuns() )
    #> function(t,Linf,K=NULL,t0=NULL) { -#> if (length(Linf)==3) { K <- Linf[[2]] -#> t0 <- Linf[[3]] -#> Linf <- Linf[[1]] } -#> Linf*(1-exp(-K*(t-t0))) -#> } -#> <bytecode: 0x000000001844e560> -#> <environment: 0x0000000017dabae8>
    ages <- 0:20 -plot(vb1(ages,Linf=20,K=0.3,t0=-0.2)~ages,type="b",pch=19)
    ( vb2 <- vbFuns("Francis") )
    #> function(t,L1,L2=NULL,L3=NULL,t1,t3=NULL) { -#> if (length(L1)==3) { L2 <- L1[[2]]; L3 <- L1[[3]]; L1 <- L1[[1]] } -#> if (length(t1)==2) { t3 <- t1[[2]]; t1 <- t1[[1]] } -#> r <- (L3-L2)/(L2-L1) -#> L1+(L3-L1)*((1-r^(2*((t-t1)/(t3-t1))))/(1-r^2)) -#> } -#> <bytecode: 0x00000000183be070> -#> <environment: 0x000000001793f0b8>
    plot(vb2(ages,L1=10,L2=19,L3=20,t1=2,t3=18)~ages,type="b",pch=19)
    ( vb2c <- vbFuns("Francis",simple=TRUE) ) # compare to vb2
    #> function(t,L1,L2,L3,t1,t3) { -#> r <- (L3-L2)/(L2-L1) -#> L1+(L3-L1)*((1-r^(2*((t-t1)/(t3-t1))))/(1-r^2)) -#> } -#> <bytecode: 0x00000000183aa7e0> -#> <environment: 0x0000000017767db0>
    +( vb1 <- vbFuns() ) +
    #> function (t, Linf, K = NULL, t0 = NULL) +#> { +#> if (length(Linf) == 3) { +#> K <- Linf[[2]] +#> t0 <- Linf[[3]] +#> Linf <- Linf[[1]] +#> } +#> Linf * (1 - exp(-K * (t - t0))) +#> } +#> <bytecode: 0x000000001f09ff58> +#> <environment: 0x000000001f1cab40>
    ages <- 0:20 +plot(vb1(ages,Linf=20,K=0.3,t0=-0.2)~ages,type="b",pch=19) +
    ( vb2 <- vbFuns("Francis") ) +
    #> function (t, L1, L2 = NULL, L3 = NULL, t1, t3 = NULL) +#> { +#> if (length(L1) == 3) { +#> L2 <- L1[[2]] +#> L3 <- L1[[3]] +#> L1 <- L1[[1]] +#> } +#> if (length(t1) == 2) { +#> t3 <- t1[[2]] +#> t1 <- t1[[1]] +#> } +#> r <- (L3 - L2)/(L2 - L1) +#> L1 + (L3 - L1) * ((1 - r^(2 * ((t - t1)/(t3 - t1))))/(1 - +#> r^2)) +#> } +#> <bytecode: 0x000000001f0ae070> +#> <environment: 0x000000001f6f5b20>
    plot(vb2(ages,L1=10,L2=19,L3=20,t1=2,t3=18)~ages,type="b",pch=19) +
    ( vb2c <- vbFuns("Francis",simple=TRUE) ) # compare to vb2 +
    #> function (t, L1, L2, L3, t1, t3) +#> { +#> r <- (L3 - L2)/(L2 - L1) +#> L1 + (L3 - L1) * ((1 - r^(2 * ((t - t1)/(t3 - t1))))/(1 - +#> r^2)) +#> } +#> <bytecode: 0x000000001f0b0000> +#> <environment: 0x000000001fc807d0>
    ## Simple Examples -- Gompertz -( gomp1 <- GompertzFuns() )
    #> function(t,Linf,gi=NULL,ti=NULL) { -#> if (length(Linf)==3) { gi <- Linf[[2]] -#> ti <- Linf[[3]] -#> Linf <- Linf[[1]] } -#> Linf*exp(-exp(-gi*(t-ti))) -#> } -#> <bytecode: 0x0000000017553550> -#> <environment: 0x000000000a179348>
    plot(gomp1(ages,Linf=800,gi=0.5,ti=5)~ages,type="b",pch=19)
    ( gomp2 <- GompertzFuns("Ricker2") )
    #> function(t,L0,a=NULL,gi=NULL) { -#> if (length(L0)==3) { a <- L0[[2]] -#> gi <- L0[[3]] -#> L0 <- L0[[1]] } -#> L0*exp(a*(1-exp(-gi*t))) -#> } -#> <bytecode: 0x0000000017545c18> -#> <environment: 0x0000000009f75d48>
    plot(gomp2(ages,L0=2,a=6,gi=0.5)~ages,type="b",pch=19)
    ( gomp2c <- GompertzFuns("Ricker2",simple=TRUE) ) # compare to gomp2
    #> function(t,L0,a,gi) { -#> L0*exp(a*(1-exp(-gi*t))) -#> } -#> <bytecode: 0x00000000175375c0> -#> <environment: 0x0000000009cc3e70>
    ( gompT <- GompertzFuns("Troynikov1"))
    #> function(Lm,dt,Linf,gi=NULL) { -#> if (length(Linf)==2) { gi <- Linf[2] -#> Linf <- Linf[1] } -#> Linf*((Lm/Linf)^exp(-gi*dt))-Lm -#> } -#> <bytecode: 0x000000000a7563f0> -#> <environment: 0x00000000099f64d0>
    +( gomp1 <- GompertzFuns() ) +
    #> function (t, Linf, gi = NULL, ti = NULL) +#> { +#> if (length(Linf) == 3) { +#> gi <- Linf[[2]] +#> ti <- Linf[[3]] +#> Linf <- Linf[[1]] +#> } +#> Linf * exp(-exp(-gi * (t - ti))) +#> } +#> <bytecode: 0x000000001fdb59f0> +#> <environment: 0x000000001fdf7250>
    plot(gomp1(ages,Linf=800,gi=0.5,ti=5)~ages,type="b",pch=19) +
    ( gomp2 <- GompertzFuns("Ricker2") ) +
    #> function (t, L0, a = NULL, gi = NULL) +#> { +#> if (length(L0) == 3) { +#> a <- L0[[2]] +#> gi <- L0[[3]] +#> L0 <- L0[[1]] +#> } +#> L0 * exp(a * (1 - exp(-gi * t))) +#> } +#> <bytecode: 0x000000001fdb85d0> +#> <environment: 0x00000000202b88a8>
    plot(gomp2(ages,L0=2,a=6,gi=0.5)~ages,type="b",pch=19) +
    ( gomp2c <- GompertzFuns("Ricker2",simple=TRUE) ) # compare to gomp2 +
    #> function (t, L0, a, gi) +#> { +#> L0 * exp(a * (1 - exp(-gi * t))) +#> } +#> <bytecode: 0x000000001fdd7b58> +#> <environment: 0x000000001f240028>
    ( gompT <- GompertzFuns("Troynikov1")) +
    #> function (Lm, dt, Linf, gi = NULL) +#> { +#> if (length(Linf) == 2) { +#> gi <- Linf[2] +#> Linf <- Linf[1] +#> } +#> Linf * ((Lm/Linf)^exp(-gi * dt)) - Lm +#> } +#> <bytecode: 0x000000001fde2728> +#> <environment: 0x000000001ecf8a00>
    ## Simple Examples -- Richards -( rich1 <- RichardsFuns() )
    #> function(t,Linf,k=NULL,a=NULL,b=NULL) { -#> if (length(Linf)==4) { k <- Linf[[2]] -#> a <- Linf[[3]] -#> b <- Linf[[4]] -#> Linf <- Linf[[1]] } -#> Linf*(1-a*exp(-k*t))^b -#> } -#> <bytecode: 0x00000000085dfc58> -#> <environment: 0x00000000081aec10>
    plot(rich1(ages,Linf=800,k=0.5,a=1,b=6)~ages,type="b",pch=19)
    ( rich2 <- RichardsFuns(2) )
    #> function(t,Linf,k=NULL,ti=NULL,b=NULL) { -#> if (length(Linf)==4) { k <- Linf[[2]] -#> ti <- Linf[[3]] -#> b <- Linf[[4]] -#> Linf <- Linf[[1]] } -#> Linf*(1-(1/b)*exp(-k*(t-ti)))^b -#> } -#> <bytecode: 0x0000000009014ef8> -#> <environment: 0x000000001d1ac9c8>
    plot(rich2(ages,Linf=800,k=0.5,ti=3,b=6)~ages,type="b",pch=19)
    ( rich3 <- RichardsFuns(3) )
    #> function(t,Linf,k=NULL,ti=NULL,b=NULL) { -#> if (length(Linf)==4) { k <- Linf[[2]] -#> ti <- Linf[[3]] -#> b <- Linf[[4]] -#> Linf <- Linf[[1]] } -#> Linf/((1+b*exp(-k*(t-ti)))^(1/b)) -#> } -#> <bytecode: 0x0000000008831a30> -#> <environment: 0x000000001aee6b08>
    plot(rich3(ages,Linf=800,k=0.5,ti=3,b=0.15)~ages,type="b",pch=19)
    ( rich4 <- RichardsFuns(4) )
    #> function(t,Linf,k=NULL,ti=NULL,b=NULL) { -#> if (length(Linf)==4) { k <- Linf[[2]] -#> ti <- Linf[[3]] -#> b <- Linf[[4]] -#> Linf <- Linf[[1]] } -#> Linf*(1+(b-1)*exp(-k*(t-ti)))^(1/(1-b)) -#> } -#> <bytecode: 0x00000000083ccf58> -#> <environment: 0x0000000019928ca0>
    plot(rich4(ages,Linf=800,k=0.5,ti=3,b=0.95)~ages,type="b",pch=19)
    lines(rich4(ages,Linf=800,k=0.5,ti=3,b=1.5)~ages,type="b",pch=19,col="blue")
    ( rich5 <- RichardsFuns(5) )
    #> function(t,Linf,k=NULL,L0=NULL,b=NULL) { -#> if (length(Linf)==4) { k <- Linf[[2]] -#> L0 <- Linf[[3]] -#> b <- Linf[[4]] -#> Linf <- Linf[[1]] } -#> Linf*(1+(((L0/Linf)^(1-b))-1)*exp(-k*t))^(1/(1-b)) -#> } -#> <bytecode: 0x00000000083b36c8> -#> <environment: 0x000000001b70c2f8>
    plot(rich5(ages,Linf=800,k=0.5,L0=50,b=1.5)~ages,type="b",pch=19)
    ( rich6 <- RichardsFuns(6) )
    #> function(t,Linf,k=NULL,ti=NULL,Lninf=NULL,b=NULL) { -#> if (length(Linf)==5) { k <- Linf[[2]] -#> ti <- Linf[[3]] -#> Lninf <- Linf[[3]] -#> b <- Linf[[4]] -#> Linf <- Linf[[1]] } -#> Lninf+(Linf-Lninf)*(1+(b-1)*exp(-k*(t-ti)))^(1/(1-b)) -#> } -#> <bytecode: 0x0000000008260ae0> -#> <environment: 0x000000001d0211e0>
    plot(rich6(ages,Linf=800,k=0.5,ti=3,Lninf=50,b=1.5)~ages,type="b",pch=19)
    ( rich2c <- RichardsFuns(2,simple=TRUE) ) # compare to rich2
    #> function(t,Linf,k,ti,b) { -#> Linf*(1-(1/b)*exp(-k*(t-ti)))^b -#> } -#> <bytecode: 0x00000000090f5c28> -#> <environment: 0x0000000018d87580>
    +( rich1 <- RichardsFuns() ) +
    #> function (t, Linf, k = NULL, a = NULL, b = NULL) +#> { +#> if (length(Linf) == 4) { +#> k <- Linf[[2]] +#> a <- Linf[[3]] +#> b <- Linf[[4]] +#> Linf <- Linf[[1]] +#> } +#> Linf * (1 - a * exp(-k * t))^b +#> } +#> <bytecode: 0x000000001d383e50> +#> <environment: 0x000000001d332000>
    plot(rich1(ages,Linf=800,k=0.5,a=1,b=6)~ages,type="b",pch=19) +
    ( rich2 <- RichardsFuns(2) ) +
    #> function (t, Linf, k = NULL, ti = NULL, b = NULL) +#> { +#> if (length(Linf) == 4) { +#> k <- Linf[[2]] +#> ti <- Linf[[3]] +#> b <- Linf[[4]] +#> Linf <- Linf[[1]] +#> } +#> Linf * (1 - (1/b) * exp(-k * (t - ti)))^b +#> } +#> <bytecode: 0x000000001d380978> +#> <environment: 0x000000001da64810>
    plot(rich2(ages,Linf=800,k=0.5,ti=3,b=6)~ages,type="b",pch=19) +
    ( rich3 <- RichardsFuns(3) ) +
    #> function (t, Linf, k = NULL, ti = NULL, b = NULL) +#> { +#> if (length(Linf) == 4) { +#> k <- Linf[[2]] +#> ti <- Linf[[3]] +#> b <- Linf[[4]] +#> Linf <- Linf[[1]] +#> } +#> Linf/((1 + b * exp(-k * (t - ti)))^(1/b)) +#> } +#> <bytecode: 0x000000001d37ceb8> +#> <environment: 0x000000001f5bb0f0>
    plot(rich3(ages,Linf=800,k=0.5,ti=3,b=0.15)~ages,type="b",pch=19) +
    ( rich4 <- RichardsFuns(4) ) +
    #> function (t, Linf, k = NULL, ti = NULL, b = NULL) +#> { +#> if (length(Linf) == 4) { +#> k <- Linf[[2]] +#> ti <- Linf[[3]] +#> b <- Linf[[4]] +#> Linf <- Linf[[1]] +#> } +#> Linf * (1 + (b - 1) * exp(-k * (t - ti)))^(1/(1 - b)) +#> } +#> <bytecode: 0x000000001d375510> +#> <environment: 0x000000001ccbf748>
    plot(rich4(ages,Linf=800,k=0.5,ti=3,b=0.95)~ages,type="b",pch=19) +
    lines(rich4(ages,Linf=800,k=0.5,ti=3,b=1.5)~ages,type="b",pch=19,col="blue") +
    ( rich5 <- RichardsFuns(5) ) +
    #> function (t, Linf, k = NULL, L0 = NULL, b = NULL) +#> { +#> if (length(Linf) == 4) { +#> k <- Linf[[2]] +#> L0 <- Linf[[3]] +#> b <- Linf[[4]] +#> Linf <- Linf[[1]] +#> } +#> Linf * (1 + (((L0/Linf)^(1 - b)) - 1) * exp(-k * t))^(1/(1 - +#> b)) +#> } +#> <bytecode: 0x000000001d361cb8> +#> <environment: 0x000000001efbbfe0>
    plot(rich5(ages,Linf=800,k=0.5,L0=50,b=1.5)~ages,type="b",pch=19) +
    ( rich6 <- RichardsFuns(6) ) +
    #> function (t, Linf, k = NULL, ti = NULL, Lninf = NULL, b = NULL) +#> { +#> if (length(Linf) == 5) { +#> k <- Linf[[2]] +#> ti <- Linf[[3]] +#> Lninf <- Linf[[3]] +#> b <- Linf[[4]] +#> Linf <- Linf[[1]] +#> } +#> Lninf + (Linf - Lninf) * (1 + (b - 1) * exp(-k * (t - ti)))^(1/(1 - +#> b)) +#> } +#> <bytecode: 0x000000001d344268> +#> <environment: 0x000000001f72cb90>
    plot(rich6(ages,Linf=800,k=0.5,ti=3,Lninf=50,b=1.5)~ages,type="b",pch=19) +
    ( rich2c <- RichardsFuns(2,simple=TRUE) ) # compare to rich2 +
    #> function (t, Linf, k, ti, b) +#> { +#> Linf * (1 - (1/b) * exp(-k * (t - ti)))^b +#> } +#> <bytecode: 0x000000001d37f6a8> +#> <environment: 0x00000000203e1ed0>
    ## Simple Examples -- Logistic -( log1 <- logisticFuns() )
    #> function(t,Linf,gninf=NULL,ti=NULL) { -#> if (length(Linf)==3) { gninf <- Linf[[2]] -#> ti <- Linf[[3]] -#> Linf <- Linf[[1]] } -#> Linf/(1+exp(-gninf*(t-ti))) -#> } -#> <bytecode: 0x000000001b41e830> -#> <environment: 0x00000000193b3f98>
    plot(log1(ages,Linf=800,gninf=0.5,ti=5)~ages,type="b",pch=19)
    ( log2 <- logisticFuns("CJ2") )
    #> function(t,Linf,gninf=NULL,a=NULL) { -#> if (length(Linf)==3) { gninf <- Linf[[2]] -#> a <- Linf[[3]] -#> Linf <- Linf[[1]] } -#> Linf/(1+a*exp(-gninf*t)) -#> } -#> <bytecode: 0x000000001b7df560> -#> <environment: 0x000000001ce79710>
    plot(log2(ages,Linf=800,gninf=0.5,a=10)~ages,type="b",pch=19)
    ( log2c <- logisticFuns("CJ2",simple=TRUE) ) # compare to log2
    #> function(t,Linf,gninf,a) { -#> Linf/(1+a*exp(-gninf*t)) -#> } -#> <bytecode: 0x000000001af8ed78> -#> <environment: 0x000000001cdc35d8>
    ( log3 <- logisticFuns("Karkach") )
    #> function(t,Linf,L0=NULL,gninf=NULL) { -#> if (length(Linf)==3) { L0 <- Linf[[2]] -#> gninf <- Linf[[3]] -#> Linf <- Linf[[1]] } -#> L0*Linf/(L0+(Linf-L0)*exp(-gninf*t)) -#> } -#> <bytecode: 0x000000001aa02d48> -#> <environment: 0x000000001d64c7d8>
    plot(log3(ages,L0=10,Linf=800,gninf=0.5)~ages,type="b",pch=19)
    ( log4 <- logisticFuns("Haddon") )
    #> function(Lm,dLmax,L50=NULL,L95=NULL) { -#> if (length(dLmax)==3) { L50 <- dLmax[2] -#> L95 <- dLmax[3] -#> dLmax <- dLmax[1] } -#> dLmax/(1+exp(log(19)*((Lm-L50)/(L95-L50)))) -#> } -#> <bytecode: 0x000000001d31e838> -#> <environment: 0x0000000008074fd0>
    +( log1 <- logisticFuns() ) +
    #> function (t, Linf, gninf = NULL, ti = NULL) +#> { +#> if (length(Linf) == 3) { +#> gninf <- Linf[[2]] +#> ti <- Linf[[3]] +#> Linf <- Linf[[1]] +#> } +#> Linf/(1 + exp(-gninf * (t - ti))) +#> } +#> <bytecode: 0x000000001ef46488> +#> <environment: 0x0000000020cc0810>
    plot(log1(ages,Linf=800,gninf=0.5,ti=5)~ages,type="b",pch=19) +
    ( log2 <- logisticFuns("CJ2") ) +
    #> function (t, Linf, gninf = NULL, a = NULL) +#> { +#> if (length(Linf) == 3) { +#> gninf <- Linf[[2]] +#> a <- Linf[[3]] +#> Linf <- Linf[[1]] +#> } +#> Linf/(1 + a * exp(-gninf * t)) +#> } +#> <bytecode: 0x000000001ef44e70> +#> <environment: 0x000000001c56a098>
    plot(log2(ages,Linf=800,gninf=0.5,a=10)~ages,type="b",pch=19) +
    ( log2c <- logisticFuns("CJ2",simple=TRUE) ) # compare to log2 +
    #> function (t, Linf, gninf, a) +#> { +#> Linf/(1 + a * exp(-gninf * t)) +#> } +#> <bytecode: 0x000000001ef47f48> +#> <environment: 0x000000001f822db0>
    ( log3 <- logisticFuns("Karkach") ) +
    #> function (t, Linf, L0 = NULL, gninf = NULL) +#> { +#> if (length(Linf) == 3) { +#> L0 <- Linf[[2]] +#> gninf <- Linf[[3]] +#> Linf <- Linf[[1]] +#> } +#> L0 * Linf/(L0 + (Linf - L0) * exp(-gninf * t)) +#> } +#> <bytecode: 0x000000001ef47928> +#> <environment: 0x000000001fcdfca8>
    plot(log3(ages,L0=10,Linf=800,gninf=0.5)~ages,type="b",pch=19) +
    ( log4 <- logisticFuns("Haddon") ) +
    #> function (Lm, dLmax, L50 = NULL, L95 = NULL) +#> { +#> if (length(dLmax) == 3) { +#> L50 <- dLmax[2] +#> L95 <- dLmax[3] +#> dLmax <- dLmax[1] +#> } +#> dLmax/(1 + exp(log(19) * ((Lm - L50)/(L95 - L50)))) +#> } +#> <bytecode: 0x000000001ef4a0d0> +#> <environment: 0x000000001d376080>
    ########################################################### ## Examples of fitting @@ -406,11 +500,13 @@

    Examp ## However, observe the correlations in the summary() results. ## Von B -plot(tl~age,data=SpotVA1,pch=19)

    +plot(tl~age,data=SpotVA1,pch=19) +
    # Fitting the typical parameterization of the von B function -fit1 <- nls(tl~vb1(age,Linf,K,t0),data=SpotVA1, - start=vbStarts(tl~age,data=SpotVA1)) -summary(fit1,correlation=TRUE)
    #> +fit1 <- nls(tl~vb1(age,Linf,K,t0),data=SpotVA1, + start=vbStarts(tl~age,data=SpotVA1)) +summary(fit1,correlation=TRUE) +
    #> #> Formula: tl ~ vb1(age, Linf, K, t0) #> #> Parameters: @@ -430,11 +526,13 @@

    Examp #> #> Number of iterations to convergence: 10 #> Achieved convergence tolerance: 5.49e-06 -#>

    curve(vb1(x,Linf=coef(fit1)),from=0,to=5,col="red",lwd=10,add=TRUE)
    +#>
    curve(vb1(x,Linf=coef(fit1)),from=0,to=5,col="red",lwd=10,add=TRUE) +
    # Fitting the Francis parameterization of the von B function -fit2 <- nls(tl~vb2c(age,L1,L2,L3,t1=0,t3=5),data=SpotVA1, - start=vbStarts(tl~age,data=SpotVA1,type="Francis",ages2use=c(0,5))) -summary(fit2,correlation=TRUE)
    #> +fit2 <- nls(tl~vb2c(age,L1,L2,L3,t1=0,t3=5),data=SpotVA1, + start=vbStarts(tl~age,data=SpotVA1,type="Francis",ages2use=c(0,5))) +summary(fit2,correlation=TRUE) +
    #> #> Formula: tl ~ vb2c(age, L1, L2, L3, t1 = 0, t3 = 5) #> #> Parameters: @@ -454,13 +552,15 @@

    Examp #> #> Number of iterations to convergence: 7 #> Achieved convergence tolerance: 9.455e-06 -#>

    curve(vb2c(x,L1=coef(fit2)[1],L2=coef(fit2)[2],L3=coef(fit2)[3],t1=0,t3=5), - from=0,to=5,col="blue",lwd=5,add=TRUE)
    +#>
    curve(vb2c(x,L1=coef(fit2)[1],L2=coef(fit2)[2],L3=coef(fit2)[3],t1=0,t3=5), + from=0,to=5,col="blue",lwd=5,add=TRUE) +
    # Fitting the Schnute parameterization of the von B function -vb3 <- vbFuns("Schnute") -fit3 <- nls(tl~vb3(age,L1,L3,K,t1=0,t3=4),data=SpotVA1, - start=vbStarts(tl~age,data=SpotVA1,type="Schnute",ages2use=c(0,4))) -summary(fit3,correlation=TRUE)
    #> +vb3 <- vbFuns("Schnute") +fit3 <- nls(tl~vb3(age,L1,L3,K,t1=0,t3=4),data=SpotVA1, + start=vbStarts(tl~age,data=SpotVA1,type="Schnute",ages2use=c(0,4))) +summary(fit3,correlation=TRUE) +
    #> #> Formula: tl ~ vb3(age, L1, L3, K, t1 = 0, t3 = 4) #> #> Parameters: @@ -480,26 +580,29 @@

    Examp #> #> Number of iterations to convergence: 8 #> Achieved convergence tolerance: 8.156e-06 -#>

    curve(vb3(x,L1=coef(fit3),t1=c(0,4)),from=0,to=5,col="green",lwd=2,add=TRUE)
    +#>
    curve(vb3(x,L1=coef(fit3),t1=c(0,4)),from=0,to=5,col="green",lwd=2,add=TRUE) +
    ## Gompertz # Make some fake data using the original parameterization -gompO <- GompertzFuns("original") +gompO <- GompertzFuns("original") # setup ages, sample sizes (general reduction in numbers with # increasing age), and additive SD to model -t <- 1:15 -n <- c(10,40,35,25,12,10,10,8,6,5,3,3,3,2,2) -sd <- 15 +t <- 1:15 +n <- c(10,40,35,25,12,10,10,8,6,5,3,3,3,2,2) +sd <- 15 # expand ages -ages <- rep(t,n) +ages <- rep(t,n) # get lengths from gompertz and a random error for individuals -lens <- gompO(ages,Linf=450,a=1,gi=0.3)+rnorm(length(ages),0,sd) +lens <- gompO(ages,Linf=450,a=1,gi=0.3)+rnorm(length(ages),0,sd) # put together as a data.frame -df <- data.frame(age=ages,len=round(lens,0)) +df <- data.frame(age=ages,len=round(lens,0)) -plot(len~age,data=df,pch=19,col=rgb(0,0,0,1/5))
    +plot(len~age,data=df,pch=19,col=rgb(0,0,0,1/5)) +
    # Fit first Ricker parameterization -fit1 <- nls(len~gomp1(age,Linf,gi,ti),data=df,start=list(Linf=500,gi=0.3,ti=3)) -summary(fit1,correlation=TRUE)
    #> +fit1 <- nls(len~gomp1(age,Linf,gi,ti),data=df,start=list(Linf=500,gi=0.3,ti=3)) +summary(fit1,correlation=TRUE) +
    #> #> Formula: len ~ gomp1(age, Linf, gi, ti) #> #> Parameters: @@ -519,10 +622,12 @@

    Examp #> #> Number of iterations to convergence: 3 #> Achieved convergence tolerance: 5.463e-07 -#>

    curve(gomp1(x,Linf=coef(fit1)),from=0,to=15,col="red",lwd=10,add=TRUE)
    +#>
    curve(gomp1(x,Linf=coef(fit1)),from=0,to=15,col="red",lwd=10,add=TRUE) +
    # Fit third Ricker parameterization -fit2 <- nls(len~gomp2(age,L0,a,gi),data=df,start=list(L0=30,a=3,gi=0.3)) -summary(fit2,correlation=TRUE)
    #> +fit2 <- nls(len~gomp2(age,L0,a,gi),data=df,start=list(L0=30,a=3,gi=0.3)) +summary(fit2,correlation=TRUE) +
    #> #> Formula: len ~ gomp2(age, L0, a, gi) #> #> Parameters: @@ -542,11 +647,13 @@

    Examp #> #> Number of iterations to convergence: 3 #> Achieved convergence tolerance: 9.415e-06 -#>

    curve(gomp2(x,L0=coef(fit2)),from=0,to=15,col="blue",lwd=5,add=TRUE)
    +#>
    curve(gomp2(x,L0=coef(fit2)),from=0,to=15,col="blue",lwd=5,add=TRUE) +
    # Fit third Quinn and Deriso parameterization (using simple=TRUE model) -gomp3 <- GompertzFuns("QD3",simple=TRUE) -fit3 <- nls(len~gomp3(age,Linf,gi,t0),data=df,start=list(Linf=500,gi=0.3,t0=0)) -summary(fit3,correlation=TRUE)
    #> +gomp3 <- GompertzFuns("QD3",simple=TRUE) +fit3 <- nls(len~gomp3(age,Linf,gi,t0),data=df,start=list(Linf=500,gi=0.3,t0=0)) +summary(fit3,correlation=TRUE) +
    #> #> Formula: len ~ gomp3(age, Linf, gi, t0) #> #> Parameters: @@ -566,29 +673,32 @@

    Examp #> #> Number of iterations to convergence: 4 #> Achieved convergence tolerance: 4.607e-07 -#>

    curve(gomp3(x,Linf=coef(fit3)[1],gi=coef(fit3)[2],t0=coef(fit3)[3]), - from=0,to=15,col="green",lwd=2,add=TRUE)
    +#>
    curve(gomp3(x,Linf=coef(fit3)[1],gi=coef(fit3)[2],t0=coef(fit3)[3]), + from=0,to=15,col="green",lwd=2,add=TRUE) +
    ## Richards -if (FALSE) { +if (FALSE) { # Fit first Richards parameterization ... DOES NOT CONVERGE -fit1 <- nls(len~rich1(age,Linf,k,a,b),data=df, - start=list(Linf=450,k=0.3,a=0.2,b=3)) -summary(fit1,correlation=TRUE) -curve(rich1(x,Linf=coef(fit1)),from=0,to=15,col="red",lwd=10,add=TRUE) +fit1 <- nls(len~rich1(age,Linf,k,a,b),data=df, + start=list(Linf=450,k=0.3,a=0.2,b=3)) +summary(fit1,correlation=TRUE) +curve(rich1(x,Linf=coef(fit1)),from=0,to=15,col="red",lwd=10,add=TRUE) # Fit second Richards parameterization ... DOES NOT CONVERGE -fit2 <- nls(len~rich2(age,Linf,k,ti,b),data=df, - start=list(Linf=450,k=0.25,ti=3,b=3)) -summary(fit2,correlation=TRUE) -curve(rich2(x,Linf=coef(fit2)),from=0,to=15,col="blue",lwd=7,add=TRUE) -} - -plot(len~age,data=df,pch=19,col=rgb(0,0,0,1/5))
    +fit2 <- nls(len~rich2(age,Linf,k,ti,b),data=df, + start=list(Linf=450,k=0.25,ti=3,b=3)) +summary(fit2,correlation=TRUE) +curve(rich2(x,Linf=coef(fit2)),from=0,to=15,col="blue",lwd=7,add=TRUE) +} + +plot(len~age,data=df,pch=19,col=rgb(0,0,0,1/5)) +
    # Fit third Richards parameterization -fit3 <- nls(len~rich3(age,Linf,k,ti,b),data=df, - start=list(Linf=450,k=0.25,ti=3,b=-0.1)) -summary(fit3,correlation=TRUE)
    #> +fit3 <- nls(len~rich3(age,Linf,k,ti,b),data=df, + start=list(Linf=450,k=0.25,ti=3,b=-0.1)) +summary(fit3,correlation=TRUE) +
    #> #> Formula: len ~ rich3(age, Linf, k, ti, b) #> #> Parameters: @@ -610,11 +720,13 @@

    Examp #> #> Number of iterations to convergence: 4 #> Achieved convergence tolerance: 8.624e-06 -#>

    curve(rich3(x,Linf=coef(fit3)),from=0,to=15,col="green",lwd=4,add=TRUE)
    +#>
    curve(rich3(x,Linf=coef(fit3)),from=0,to=15,col="green",lwd=4,add=TRUE) +
    # Fit fourth Richards parameterization -fit4 <- nls(len~rich4(age,Linf,k,ti,b),data=df, - start=list(Linf=450,k=0.25,ti=3,b=0.7)) -summary(fit4,correlation=TRUE)
    #> +fit4 <- nls(len~rich4(age,Linf,k,ti,b),data=df, + start=list(Linf=450,k=0.25,ti=3,b=0.7)) +summary(fit4,correlation=TRUE) +
    #> #> Formula: len ~ rich4(age, Linf, k, ti, b) #> #> Parameters: @@ -636,13 +748,16 @@

    Examp #> #> Number of iterations to convergence: 4 #> Achieved convergence tolerance: 2.301e-06 -#>

    curve(rich4(x,Linf=coef(fit4)),from=0,to=15,col="black",lwd=1,add=TRUE)
    +#>
    curve(rich4(x,Linf=coef(fit4)),from=0,to=15,col="black",lwd=1,add=TRUE) +
    ## Logistic -plot(len~age,data=df,pch=19,col=rgb(0,0,0,1/5))
    +plot(len~age,data=df,pch=19,col=rgb(0,0,0,1/5)) +
    # Fit first Campana-Jones parameterization -fit1 <- nls(len~log1(age,Linf,gninf,ti),data=df, - start=list(Linf=450,gninf=0.45,ti=4)) -summary(fit1,correlation=TRUE)
    #> +fit1 <- nls(len~log1(age,Linf,gninf,ti),data=df, + start=list(Linf=450,gninf=0.45,ti=4)) +summary(fit1,correlation=TRUE) +
    #> #> Formula: len ~ log1(age, Linf, gninf, ti) #> #> Parameters: @@ -662,11 +777,13 @@

    Examp #> #> Number of iterations to convergence: 4 #> Achieved convergence tolerance: 7.635e-07 -#>

    curve(log1(x,Linf=coef(fit1)),from=0,to=15,col="red",lwd=10,add=TRUE)
    +#>
    curve(log1(x,Linf=coef(fit1)),from=0,to=15,col="red",lwd=10,add=TRUE) +
    # Fit second Campana-Jones parameterization -fit2 <- nls(len~log2(age,Linf,gninf,a),data=df, - start=list(Linf=450,gninf=0.45,a=7)) -summary(fit2,correlation=TRUE)
    #> +fit2 <- nls(len~log2(age,Linf,gninf,a),data=df, + start=list(Linf=450,gninf=0.45,a=7)) +summary(fit2,correlation=TRUE) +
    #> #> Formula: len ~ log2(age, Linf, gninf, a) #> #> Parameters: @@ -686,12 +803,14 @@

    Examp #> #> Number of iterations to convergence: 4 #> Achieved convergence tolerance: 8.456e-06 -#>

    curve(log2(x,Linf=coef(fit2)),from=0,to=15,col="blue",lwd=5,add=TRUE)
    +#>
    curve(log2(x,Linf=coef(fit2)),from=0,to=15,col="blue",lwd=5,add=TRUE) +
    # Fit Karkach parameterization (using simple=TRUE model) -log3 <- logisticFuns("Karkach",simple=TRUE) -fit3 <- nls(len~log3(age,Linf,L0,gninf),data=df, - start=list(Linf=450,L0=30,gninf=0.45)) -summary(fit3,correlation=TRUE)
    #> +log3 <- logisticFuns("Karkach",simple=TRUE) +fit3 <- nls(len~log3(age,Linf,L0,gninf),data=df, + start=list(Linf=450,L0=30,gninf=0.45)) +summary(fit3,correlation=TRUE) +
    #> #> Formula: len ~ log3(age, Linf, L0, gninf) #> #> Parameters: @@ -711,24 +830,37 @@

    Examp #> #> Number of iterations to convergence: 5 #> Achieved convergence tolerance: 6.738e-06 -#>

    curve(log3(x,Linf=coef(fit3)[1],L0=coef(fit3)[2],gninf=coef(fit3)[3]), - from=0,to=15,col="green",lwd=2,add=TRUE)
    +#>
    curve(log3(x,Linf=coef(fit3)[1],L0=coef(fit3)[2],gninf=coef(fit3)[3]), + from=0,to=15,col="green",lwd=2,add=TRUE) +
    ############################################################################# ## Create expressions of the models ############################################################################# # Typical von Bertalanffy ... Show as a stand-alone plot -growthFunShow("vonBertalanffy","Typical",plot=TRUE)
    #> expression(E(L[t]) == L[infinity] * bgroup("(", 1 - e^{ +growthFunShow("vonBertalanffy","Typical",plot=TRUE) +
    #> expression(E(L[t]) == L[infinity] * bgroup("(", 1 - e^{ #> -K * (t ~ -~t[0]) #> }, ")"))
    # Get and save the expression -( tmp <- growthFunShow("vonBertalanffy","Typical") )
    #> expression(E(L[t]) == L[infinity] * bgroup("(", 1 - e^{ +( tmp <- growthFunShow("vonBertalanffy","Typical") ) +
    #> expression(E(L[t]) == L[infinity] * bgroup("(", 1 - e^{ #> -K * (t ~ -~t[0]) #> }, ")"))
    # Use expression as title on a plot -lens <- vb1(ages,Linf=20,K=0.3,t0=-0.2) -plot(lens~ages,type="b",pch=19,main=tmp)
    # Put expression in the main plot -text(10,5,tmp)
    # Put multiple expressions on a plot -op <- par(mar=c(0.1,0.1,0.1,0.1)) -plot(0,type="n",xlab="",ylab="",xlim=c(0,1),ylim=c(0,3),xaxt="n",yaxt="n")
    text(0,2.5,"Original:",pos=4)
    text(0.5,2.5,growthFunShow("vonBertalanffy","Original"))
    text(0,1.5,"Typical:",pos=4)
    text(0.5,1.5,growthFunShow("vonBertalanffy","Typical"))
    text(0,0.5,"Francis:",pos=4)
    text(0.5,0.5,growthFunShow("vonBertalanffy","Francis"))
    par(op)
    +lens<-vb1(ages,Linf=20,K=0.3,t0=-0.2) +plot(lens~ages,type="b",pch=19,main=tmp) +
    # Put expression in the main plot +text(10,5,tmp) +
    # Put multiple expressions on a plot +op <- par(mar=c(0.1,0.1,0.1,0.1)) +plot(0,type="n",xlab="",ylab="",xlim=c(0,1),ylim=c(0,3),xaxt="n",yaxt="n") +
    text(0,2.5,"Original:",pos=4) +
    text(0.5,2.5,growthFunShow("vonBertalanffy","Original")) +
    text(0,1.5,"Typical:",pos=4) +
    text(0.5,1.5,growthFunShow("vonBertalanffy","Typical")) +
    text(0,0.5,"Francis:",pos=4) +
    text(0.5,0.5,growthFunShow("vonBertalanffy","Francis")) +
    par(op) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/headtail.html b/docs/reference/headtail.html index 9e710f80..4825294d 100644 --- a/docs/reference/headtail.html +++ b/docs/reference/headtail.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Shows rows from the head and tail of a data frame or matrix.

    Shows rows from the head and tail of a data frame or matrix.

    -
    headtail(x, n = 3L, which = NULL, addrownums = TRUE, ...)
    +
    headtail(x, n = 3L, which = NULL, addrownums = TRUE, ...)

    Arguments

    @@ -164,15 +164,20 @@

    Note

    See also

    peek

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    headtail(iris)
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species +
    headtail(iris) +
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 1.4 0.2 setosa #> 3 4.7 3.2 1.3 0.2 setosa #> 148 6.5 3.0 5.2 2.0 virginica #> 149 6.2 3.4 5.4 2.3 virginica -#> 150 5.9 3.0 5.1 1.8 virginica
    headtail(iris,10)
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species +#> 150 5.9 3.0 5.1 1.8 virginica
    headtail(iris,10) +
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 1.4 0.2 setosa #> 3 4.7 3.2 1.3 0.2 setosa @@ -192,19 +197,22 @@

    Examp #> 147 6.3 2.5 5.0 1.9 virginica #> 148 6.5 3.0 5.2 2.0 virginica #> 149 6.2 3.4 5.4 2.3 virginica -#> 150 5.9 3.0 5.1 1.8 virginica

    headtail(iris,which=c("Sepal.Length","Sepal.Width","Species"))
    #> Sepal.Length Sepal.Width Species +#> 150 5.9 3.0 5.1 1.8 virginica
    headtail(iris,which=c("Sepal.Length","Sepal.Width","Species")) +
    #> Sepal.Length Sepal.Width Species #> 1 5.1 3.5 setosa #> 2 4.9 3.0 setosa #> 3 4.7 3.2 setosa #> 148 6.5 3.0 virginica #> 149 6.2 3.4 virginica -#> 150 5.9 3.0 virginica
    headtail(iris,which=grep("Sepal",names(iris)))
    #> Sepal.Length Sepal.Width +#> 150 5.9 3.0 virginica
    headtail(iris,which=grep("Sepal",names(iris))) +
    #> Sepal.Length Sepal.Width #> 1 5.1 3.5 #> 2 4.9 3.0 #> 3 4.7 3.2 #> 148 6.5 3.0 #> 149 6.2 3.4 -#> 150 5.9 3.0
    headtail(iris,n=200)
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species +#> 150 5.9 3.0
    headtail(iris,n=200) +
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 1.4 0.2 setosa #> 3 4.7 3.2 1.3 0.2 setosa @@ -356,14 +364,16 @@

    Examp #> 149 6.2 3.4 5.4 2.3 virginica #> 150 5.9 3.0 5.1 1.8 virginica

    ## Make a matrix for demonstration purposes only -miris <- as.matrix(iris[,1:4]) -headtail(miris)
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width +miris <- as.matrix(iris[,1:4]) +headtail(miris) +
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width #> [1,] 5.1 3.5 1.4 0.2 #> [2,] 4.9 3.0 1.4 0.2 #> [3,] 4.7 3.2 1.3 0.2 #> [148,] 6.5 3.0 5.2 2.0 #> [149,] 6.2 3.4 5.4 2.3 -#> [150,] 5.9 3.0 5.1 1.8
    headtail(miris,10)
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width +#> [150,] 5.9 3.0 5.1 1.8
    headtail(miris,10) +
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width #> [1,] 5.1 3.5 1.4 0.2 #> [2,] 4.9 3.0 1.4 0.2 #> [3,] 4.7 3.2 1.3 0.2 @@ -383,13 +393,15 @@

    Examp #> [147,] 6.3 2.5 5.0 1.9 #> [148,] 6.5 3.0 5.2 2.0 #> [149,] 6.2 3.4 5.4 2.3 -#> [150,] 5.9 3.0 5.1 1.8

    headtail(miris,addrownums=FALSE)
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width +#> [150,] 5.9 3.0 5.1 1.8
    headtail(miris,addrownums=FALSE) +
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width #> [1,] 5.1 3.5 1.4 0.2 #> [2,] 4.9 3.0 1.4 0.2 #> [3,] 4.7 3.2 1.3 0.2 #> [4,] 6.5 3.0 5.2 2.0 #> [5,] 6.2 3.4 5.4 2.3 -#> [6,] 5.9 3.0 5.1 1.8
    headtail(miris,10,which=2:4)
    #> Sepal.Width Petal.Length Petal.Width +#> [6,] 5.9 3.0 5.1 1.8
    headtail(miris,10,which=2:4) +
    #> Sepal.Width Petal.Length Petal.Width #> [1,] 3.5 1.4 0.2 #> [2,] 3.0 1.4 0.2 #> [3,] 3.2 1.3 0.2 @@ -410,23 +422,16 @@

    Examp #> [148,] 3.0 5.2 2.0 #> [149,] 3.4 5.4 2.3 #> [150,] 3.0 5.1 1.8

    -## Make a tbl_df type from dplyr ... note how headtail() +## Make a tbl_df type from tibble ... note how headtail() ## is not limited by the tbl_df restriction on number of ## rows to show (but head() is). -if (require(dplyr)) { - iris2 <- tbl_df(iris) - class(iris2) - headtail(iris2,n=15) - head(iris2,n=30) -}
    #> Loading required package: dplyr
    #> -#> Attaching package: 'dplyr'
    #> The following objects are masked from 'package:stats': -#> -#> filter, lag
    #> The following objects are masked from 'package:base': -#> -#> intersect, setdiff, setequal, union
    #> Warning: `tbl_df()` is deprecated as of dplyr 1.0.0. -#> Please use `tibble::as_tibble()` instead. -#> This warning is displayed once every 8 hours. -#> Call `lifecycle::last_warnings()` to see where this warning was generated.
    #> # A tibble: 30 x 5 +if (require(tibble)) { + iris2 <- as_tibble(iris) + class(iris2) + headtail(iris2,n=15) + head(iris2,n=15) +} +
    #> Loading required package: tibble
    #> Warning: package 'tibble' was built under R version 4.0.3
    #> # A tibble: 15 x 5 #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> <dbl> <dbl> <dbl> <dbl> <fct> #> 1 5.1 3.5 1.4 0.2 setosa @@ -439,7 +444,11 @@

    Examp #> 8 5 3.4 1.5 0.2 setosa #> 9 4.4 2.9 1.4 0.2 setosa #> 10 4.9 3.1 1.5 0.1 setosa -#> # ... with 20 more rows

    +#> 11 5.4 3.7 1.5 0.2 setosa +#> 12 4.8 3.4 1.6 0.2 setosa +#> 13 4.8 3 1.4 0.1 setosa +#> 14 4.3 3 1.1 0.1 setosa +#> 15 5.8 4 1.2 0.2 setosa
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/hist.formula-1.png b/docs/reference/hist.formula-1.png index 096fcbef..336cc790 100644 Binary files a/docs/reference/hist.formula-1.png and b/docs/reference/hist.formula-1.png differ diff --git a/docs/reference/hist.formula-10.png b/docs/reference/hist.formula-10.png index 81ffc91f..dc3ab622 100644 Binary files a/docs/reference/hist.formula-10.png and b/docs/reference/hist.formula-10.png differ diff --git a/docs/reference/hist.formula-11.png b/docs/reference/hist.formula-11.png index f85a14e7..985d9938 100644 Binary files a/docs/reference/hist.formula-11.png and b/docs/reference/hist.formula-11.png differ diff --git a/docs/reference/hist.formula-12.png b/docs/reference/hist.formula-12.png index 3316a01e..a05863d6 100644 Binary files a/docs/reference/hist.formula-12.png and b/docs/reference/hist.formula-12.png differ diff --git a/docs/reference/hist.formula-13.png b/docs/reference/hist.formula-13.png index 602da28f..c6ef8f8c 100644 Binary files a/docs/reference/hist.formula-13.png and b/docs/reference/hist.formula-13.png differ diff --git a/docs/reference/hist.formula-14.png b/docs/reference/hist.formula-14.png index 6dd5fe5f..c24a072f 100644 Binary files a/docs/reference/hist.formula-14.png and b/docs/reference/hist.formula-14.png differ diff --git a/docs/reference/hist.formula-15.png b/docs/reference/hist.formula-15.png index fcedef3f..18fe2727 100644 Binary files a/docs/reference/hist.formula-15.png and b/docs/reference/hist.formula-15.png differ diff --git a/docs/reference/hist.formula-16.png b/docs/reference/hist.formula-16.png index a010b803..12bfc995 100644 Binary files a/docs/reference/hist.formula-16.png and b/docs/reference/hist.formula-16.png differ diff --git a/docs/reference/hist.formula-2.png b/docs/reference/hist.formula-2.png index d632410d..da45e8b2 100644 Binary files a/docs/reference/hist.formula-2.png and b/docs/reference/hist.formula-2.png differ diff --git a/docs/reference/hist.formula-3.png b/docs/reference/hist.formula-3.png index ca8e5c8c..e29f1a2f 100644 Binary files a/docs/reference/hist.formula-3.png and b/docs/reference/hist.formula-3.png differ diff --git a/docs/reference/hist.formula-4.png b/docs/reference/hist.formula-4.png index 6dd5fe5f..c24a072f 100644 Binary files a/docs/reference/hist.formula-4.png and b/docs/reference/hist.formula-4.png differ diff --git a/docs/reference/hist.formula-5.png b/docs/reference/hist.formula-5.png index fa9054c3..12002a79 100644 Binary files a/docs/reference/hist.formula-5.png and b/docs/reference/hist.formula-5.png differ diff --git a/docs/reference/hist.formula-6.png b/docs/reference/hist.formula-6.png index bff8cbc3..2190fd33 100644 Binary files a/docs/reference/hist.formula-6.png and b/docs/reference/hist.formula-6.png differ diff --git a/docs/reference/hist.formula-7.png b/docs/reference/hist.formula-7.png index ef84a1f4..7dad13d3 100644 Binary files a/docs/reference/hist.formula-7.png and b/docs/reference/hist.formula-7.png differ diff --git a/docs/reference/hist.formula-8.png b/docs/reference/hist.formula-8.png index 16bcb418..52088a70 100644 Binary files a/docs/reference/hist.formula-8.png and b/docs/reference/hist.formula-8.png differ diff --git a/docs/reference/hist.formula-9.png b/docs/reference/hist.formula-9.png index 12e2d633..adec7f7b 100644 Binary files a/docs/reference/hist.formula-9.png and b/docs/reference/hist.formula-9.png differ diff --git a/docs/reference/hist.formula.html b/docs/reference/hist.formula.html index ffabf264..d04102de 100644 --- a/docs/reference/hist.formula.html +++ b/docs/reference/hist.formula.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -129,26 +129,26 @@

    Creates separate histograms by levels.

    # S3 method for formula
    -hist(
    -  formula,
    -  data = NULL,
    -  main = "",
    -  right = FALSE,
    -  pre.main = "",
    -  xlab = NULL,
    -  ylab = "Frequency",
    -  same.breaks = TRUE,
    -  breaks = "Sturges",
    -  w = NULL,
    -  same.ylim = TRUE,
    -  ymax = NULL,
    -  col = "gray90",
    -  nrow = round(sqrt(num)),
    -  ncol = ceiling(sqrt(num)),
    -  byrow = TRUE,
    -  iaxs = TRUE,
    -  ...
    -)
    +hist( + formula, + data =NULL, + main ="", + right =FALSE, + pre.main ="", + xlab =NULL, + ylab ="Frequency", + same.breaks =TRUE, + breaks ="Sturges", + w =NULL, + same.ylim =TRUE, + ymax =NULL, + col ="gray90", + nrow =round(sqrt(num)), + ncol =ceiling(sqrt(num)), + byrow =TRUE, + iaxs =TRUE, + ... +)

    Arguments

    @@ -246,46 +246,66 @@

    <

    3-Plotting Fundamentals.

    References

    -

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

    +

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

    See also

    See base hist for related functionality and multhist in plotrix for similar functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com, but this implementation is largely a modification of the code provided by Marc Schwartz on the R-help mailing list on 1Jun07.

    Examples

    ## Using the defaults -hist(Sepal.Length~Species,data=iris)
    +hist(Sepal.Length~Species,data=iris) +
    ## Add x-labels and use a pre-fix on the main labels -hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)", - pre.main="Species==")
    +hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)", + pre.main="Species==") +
    ## Use different breaks and different y-axis limits for each graph -hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)", - same.breaks=FALSE,same.ylim=FALSE)
    +hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)", + same.breaks=FALSE,same.ylim=FALSE) +
    ## Use same but user-controlled breaks for each graph -hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)", - breaks=seq(4,8,1))
    +hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)", + breaks=seq(4,8,1)) +
    ## Use same but user-controlled maximum value for y-axis -hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)",ymax=30)
    +hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)",ymax=30) +
    ## Control the organization of the 'grid' of histograms -hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)",nrow=1,ncol=3)
    +hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)",nrow=1,ncol=3) +
    ## Use right=FALSE & freq=FALSE to demon sending an argument used by base hist() -hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)",right=FALSE, - freq=FALSE,ymax=2)
    +hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)",right=FALSE, + freq=FALSE,ymax=2) +
    ## Add a junk variable to the iris data set to show two factors on RHS -iris$junk <- factor(sample(c("A","B"),nrow(iris),replace=TRUE)) -hist(Sepal.Length~Species*junk,data=iris,xlab="Sepal Length (cm)")
    +iris$junk <- factor(sample(c("A","B"),nrow(iris),replace=TRUE)) +hist(Sepal.Length~Species*junk,data=iris,xlab="Sepal Length (cm)") +
    ## Single histogram without grouping using formula notation -hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)")
    +hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)") +
    ## Single histogram with "axis correction" turned off (compare to previous) -hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)",iaxs=FALSE)
    +hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)",iaxs=FALSE) +
    ## Single histogram with "axis correction", testing xlim and ylim -hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)", - xlim=c(3.8,8.2),ylim=c(0,35))
    hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)", - xlim=c(3.8,8.2),ymax=35)
    +hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)", + xlim=c(3.8,8.2),ylim=c(0,35)) +
    hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)", + xlim=c(3.8,8.2),ymax=35) +
    ## Using the bin width argument -hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)",w=1)
    hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)",w=0.25)
    hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)",w=1)
    hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)",w=0.25)
    +hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)",w=1) +
    hist(~Sepal.Length,data=iris,xlab="Sepal Length (cm)",w=0.25) +
    hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)",w=1) +
    hist(Sepal.Length~Species,data=iris,xlab="Sepal Length (cm)",w=0.25) +
    ## Using a vector (and not a data.frame) -vec <- 1:100 -hist(~vec)
    +vec <- 1:100 +hist(~vec) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/histFromSum-1.png b/docs/reference/histFromSum-1.png index 6caa6c00..900d6e26 100644 Binary files a/docs/reference/histFromSum-1.png and b/docs/reference/histFromSum-1.png differ diff --git a/docs/reference/histFromSum-2.png b/docs/reference/histFromSum-2.png index 197e0b52..08e31f05 100644 Binary files a/docs/reference/histFromSum-2.png and b/docs/reference/histFromSum-2.png differ diff --git a/docs/reference/histFromSum-3.png b/docs/reference/histFromSum-3.png index 9825c3c9..b4a996b2 100644 Binary files a/docs/reference/histFromSum-3.png and b/docs/reference/histFromSum-3.png differ diff --git a/docs/reference/histFromSum-4.png b/docs/reference/histFromSum-4.png index 98d3afe1..340e45f3 100644 Binary files a/docs/reference/histFromSum-4.png and b/docs/reference/histFromSum-4.png differ diff --git a/docs/reference/histFromSum-5.png b/docs/reference/histFromSum-5.png index dec15666..fb79502f 100644 Binary files a/docs/reference/histFromSum-5.png and b/docs/reference/histFromSum-5.png differ diff --git a/docs/reference/histFromSum-6.png b/docs/reference/histFromSum-6.png index 7e0b932a..1439bb38 100644 Binary files a/docs/reference/histFromSum-6.png and b/docs/reference/histFromSum-6.png differ diff --git a/docs/reference/histFromSum.html b/docs/reference/histFromSum.html index e8170fdc..bcfc60e8 100644 --- a/docs/reference/histFromSum.html +++ b/docs/reference/histFromSum.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,16 +128,16 @@

    Create a histogram from a frequency table.

    Creates a histogram from values in a frequency table. Primarily used with already summarized length frequency data.

    -
    histFromSum(x, ...)
    +    
    histFromSum(x, ...)
     
     # S3 method for default
    -histFromSum(x, y, ...)
    +histFromSum(x, y, ...)
     
     # S3 method for table
    -histFromSum(x, ...)
    +histFromSum(x, ...)
     
     # S3 method for formula
    -histFromSum(x, data = NULL, ...)
    +histFromSum(x, data = NULL, ...)

    Arguments

    @@ -169,26 +169,32 @@

    Details

    See also

    See hist and hist.formula for related functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Make some dummy data with a length category variable -set.seed(634434789) -df <- data.frame(tl=round(rnorm(100,100,20))) -df$lcat10 <- lencat(df$tl,w=10) +set.seed(634434789) +df <- data.frame(tl=round(rnorm(100,100,20))) +df$lcat10 <- lencat(df$tl,w=10) ## Summarize as tables -( tbl1 <- xtabs(~lcat10,data=df) )
    #> lcat10 +( tbl1 <- xtabs(~lcat10,data=df) ) +
    #> lcat10 #> 20 50 60 70 80 90 100 110 120 130 140 150 -#> 1 1 5 7 10 24 19 19 7 3 3 1
    ( tbl2 <- table(df$lcat10) )
    #> +#> 1 1 5 7 10 24 19 19 7 3 3 1
    ( tbl2 <- table(df$lcat10) ) +
    #> #> 20 50 60 70 80 90 100 110 120 130 140 150 #> 1 1 5 7 10 24 19 19 7 3 3 1
    ## Turn the tables into a data.frame for testing (convert ## the categories variables to numeric with fact2num()) -df2 <- data.frame(tbl1) -df2$lcat10 <- fact2num(df2$lcat10) +df2 <- data.frame(tbl1) +df2$lcat10 <- fact2num(df2$lcat10) ## Turn the table into a matrix for testing -( mat1 <- cbind(lcat10=as.numeric(rownames(tbl1)),freq=tbl1) )
    #> lcat10 freq +( mat1 <- cbind(lcat10=as.numeric(rownames(tbl1)),freq=tbl1) ) +
    #> lcat10 freq #> 20 20 1 #> 50 50 1 #> 60 60 5 @@ -202,17 +208,23 @@

    Examp #> 140 140 3 #> 150 150 1

    ## Histogram of the raw data ... set breaks and x-axis label -brks <- seq(20,160,10) -xlbl <- "Total Length (mm)" -hist(~tl,data=df,breaks=brks,xlab=xlbl)
    +brks <- seq(20,160,10) +xlbl <- "Total Length (mm)" +hist(~tl,data=df,breaks=brks,xlab=xlbl) +
    ## Use this function with various inputs ... changed colors ## on each plot so that it was obvious that a new plot was made. # table from xtabs() -histFromSum(tbl1,breaks=brks,xlab=xlbl,col="gray75")
    # table from table() -histFromSum(tbl2,breaks=brks,xlab=xlbl,col="gray70")
    # vectors from data.frame -histFromSum(df2$lcat10,df2$Freq,breaks=brks,xlab=xlbl,col="gray65")
    # vectors from matrix -histFromSum(mat1[,"lcat10"],mat1[,"freq"],breaks=brks,xlab=xlbl,col="gray60")
    # formula from a data.frame -histFromSum(Freq~lcat10,data=df2,breaks=brks,xlab=xlbl,col="gray55")
    +histFromSum(tbl1,breaks=brks,xlab=xlbl,col="gray75") +
    # table from table() +histFromSum(tbl2,breaks=brks,xlab=xlbl,col="gray70") +
    # vectors from data.frame +histFromSum(df2$lcat10,df2$Freq,breaks=brks,xlab=xlbl,col="gray65") +
    # vectors from matrix +histFromSum(mat1[,"lcat10"],mat1[,"freq"],breaks=brks,xlab=xlbl,col="gray60") +
    # formula from a data.frame +histFromSum(Freq~lcat10,data=df2,breaks=brks,xlab=xlbl,col="gray55") +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/hoCoef.html b/docs/reference/hoCoef.html index 7b338aec..79765080 100644 --- a/docs/reference/hoCoef.html +++ b/docs/reference/hoCoef.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Performs a hypothesis test that a linear model parameter is equal to a speci

    Performs a hypothesis test that a linear model parameter is equal to a specific value. Useful for testing that a parameter is equal to a value other than 0.

    -
    hoCoef(object, term = 2, bo = 0, alt = c("two.sided", "less", "greater"))
    +
    hoCoef(object, term = 2, bo = 0, alt = c("two.sided", "less", "greater"))

    Arguments

    @@ -160,12 +160,16 @@

    Details

    If the lm object is from a simple linear regression with an intercept then term=1 will use the intercept and term=2 will use the slope in the hypothesis test.

    See also

    - + +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    # Simple linear regression test HA:slope!=0.1 -lm1 <- lm(mirex~weight, data=Mirex) -hoCoef(lm1,2,0.1)
    #> term Ho Value Estimate Std. Error T df p value +lm1 <- lm(mirex~weight, data=Mirex) +hoCoef(lm1,2,0.1) +
    #> term Ho Value Estimate Std. Error T df p value #> 2 0.1 0.01216125 0.002359903 -37.22135 120 9.341981e-68
    @@ -183,7 +187,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/hyperCI.html b/docs/reference/hyperCI.html index 2e48d638..7b90ed84 100644 --- a/docs/reference/hyperCI.html +++ b/docs/reference/hyperCI.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Confidence interval for population size (N) in hypergeometric distribution.<

    Computes a confidence interval for population size (N) in hypergeometric distribution.

    -
    hyperCI(M, n, m, conf.level = 0.95)
    +
    hyperCI(M, n, m, conf.level = 0.95)

    Arguments

    @@ -160,9 +160,13 @@

    Details

    Note

    This algorithm is experimental at this point.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    hyperCI(50,25,10)
    #> 95% LCI 95% UCI +
    hyperCI(50,25,10) +
    #> 95% LCI 95% UCI #> [1,] 86 228
    @@ -180,7 +184,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/index.html b/docs/reference/index.html index a9dac597..b730874b 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -79,7 +79,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -862,7 +862,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/knitUtil.html b/docs/reference/knitUtil.html index a6ad3460..71f286c9 100644 --- a/docs/reference/knitUtil.html +++ b/docs/reference/knitUtil.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,33 +128,33 @@

    Specific utilities for use in a knitr document.

    Specific utilities for pretty printing various items in a knitr document.

    -
    kCounts(value, capitalize = FALSE)
    -
    -kPvalue(value, digits = 4, include.p = TRUE, latex = TRUE)
    -
    -purl2(
    -  file,
    -  out.dir = NULL,
    -  newname = NULL,
    -  topnotes = NULL,
    -  moreItems = NULL,
    -  blanks = c("extra", "all", "none"),
    -  delHeader = NULL,
    -  timestamp = TRUE,
    -  ...
    -)
    -
    -reproInfo(
    -  out = c("r", "markdown", "latex"),
    -  rqrdPkgs = NULL,
    -  elapsed = NULL,
    -  width = 0.95 * getOption("width"),
    -  addTOC = TRUE,
    -  newpage = FALSE,
    -  links = NULL,
    -  closeGraphics = TRUE,
    -  ind = 1
    -)
    +
    kCounts(value, capitalize = FALSE)
    +
    +kPvalue(value, digits = 4, include.p = TRUE, latex = TRUE)
    +
    +purl2(
    +  file,
    +  out.dir = NULL,
    +  newname = NULL,
    +  topnotes = NULL,
    +  moreItems = NULL,
    +  blanks = c("extra", "all", "none"),
    +  delHeader = NULL,
    +  timestamp = TRUE,
    +  ...
    +)
    +
    +reproInfo(
    +  out = c("r", "markdown", "latex"),
    +  rqrdPkgs = NULL,
    +  elapsed = NULL,
    +  width = 0.95 * getOption("width"),
    +  addTOC = TRUE,
    +  newpage = FALSE,
    +  links = NULL,
    +  closeGraphics = TRUE,
    +  ind = 1
    +)

    Arguments

    @@ -279,10 +279,23 @@

    Note

    See also

    See formatC for functionality similar to kPvalue. See purl and knit in knitr for functionality similar to purl2.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    kCounts(7)
    #> [1] "seven"
    kCounts(17)
    #> [1] 17
    kCounts(0)
    #> [1] "zero"
    kCounts(-6)
    #> [1] -6
    kCounts(3,capitalize=TRUE)
    #> [1] "Three"
    -kPvalue(0.123456789)
    #> [1] "$p=0.1235$"
    kPvalue(0.000123456)
    #> [1] "$p=0.0001$"
    kPvalue(0.000012345)
    #> [1] "$p<0.00005$"
    kPvalue(0.000012345,include.p=FALSE)
    #> [1] "$<0.00005$"
    kPvalue(0.000012345,include.p=FALSE,latex=FALSE)
    #> [1] "<0.00005"
    +
    kCounts(7) +
    #> [1] "seven"
    kCounts(17) +
    #> [1] 17
    kCounts(0) +
    #> [1] "zero"
    kCounts(-6) +
    #> [1] -6
    kCounts(3,capitalize=TRUE) +
    #> [1] "Three"
    +kPvalue(0.123456789) +
    #> [1] "$p=0.1235$"
    kPvalue(0.000123456) +
    #> [1] "$p=0.0001$"
    kPvalue(0.000012345) +
    #> [1] "$p<0.00005$"
    kPvalue(0.000012345,include.p=FALSE) +
    #> [1] "$<0.00005$"
    kPvalue(0.000012345,include.p=FALSE,latex=FALSE) +
    #> [1] "<0.00005"
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/ksTest.html b/docs/reference/ksTest.html index 1416009d..ca85fe3c 100644 --- a/docs/reference/ksTest.html +++ b/docs/reference/ksTest.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,25 +128,25 @@

    Kolmogorov-Smirnov Tests.

    Performs a one- or two-sample Kolmogorov-Smirnov test. Includes the option to perform the two-sample test using the formula notation.

    -
    ksTest(x, ...)
    +    
    ksTest(x, ...)
     
     # S3 method for default
    -ksTest(
    -  x,
    -  y,
    -  ...,
    -  alternative = c("two.sided", "less", "greater"),
    -  exact = NULL
    -)
    +ksTest(
    +  x,
    +  y,
    +  ...,
    +  alternative = c("two.sided", "less", "greater"),
    +  exact = NULL
    +)
     
     # S3 method for formula
    -ksTest(
    -  x,
    -  data = NULL,
    -  ...,
    -  alternative = c("two.sided", "less", "greater"),
    -  exact = NULL
    -)
    +ksTest( + x, + data = NULL, + ..., + alternative = c("two.sided", "less", "greater"), + exact = NULL +)

    Arguments

    @@ -186,23 +186,28 @@

    Details

    See also

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## see ks.test for other examples -x <- rnorm(50) -y <- runif(30) -df <- data.frame(dat=c(x,y), - grp=factor(rep(c("x","y"),c(50,30))), - stringsAsFactors=FALSE) +x <- rnorm(50) +y <- runif(30) +df <- data.frame(dat=c(x,y), + grp=factor(rep(c("x","y"),c(50,30))), + stringsAsFactors=FALSE) ## one-sample (from ks.test) still works -ksTest(x+2, "pgamma", 3, 2)
    #> +ksTest(x+2, "pgamma", 3, 2) +
    #> #> One-sample Kolmogorov-Smirnov test #> #> data: x #> D = 0.21652, p-value = 0.01546 #> alternative hypothesis: two-sided -#>
    ks.test(x+2, "pgamma", 3, 2)
    #> +#>
    ks.test(x+2, "pgamma", 3, 2) +
    #> #> One-sample Kolmogorov-Smirnov test #> #> data: x + 2 @@ -210,13 +215,15 @@

    Examp #> alternative hypothesis: two-sided #>

    ## first two-sample example in ?ks.test -ksTest(x,y)
    #> +ksTest(x,y) +
    #> #> Two-sample Kolmogorov-Smirnov test #> #> data: x and y #> D = 0.6, p-value = 8.598e-07 #> alternative hypothesis: two-sided -#>
    ks.test(x,y)
    #> +#>
    ks.test(x,y) +
    #> #> Two-sample Kolmogorov-Smirnov test #> #> data: x and y @@ -224,7 +231,8 @@

    Examp #> alternative hypothesis: two-sided #>

    ## same as above but using data.frame and formula -ksTest(dat~grp,data=df)
    #> +ksTest(dat~grp,data=df) +
    #> #> Two-sample Kolmogorov-Smirnov test #> #> data: x and y @@ -247,7 +255,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/lagratio.html b/docs/reference/lagratio.html index 5f2b137a..345ea86b 100644 --- a/docs/reference/lagratio.html +++ b/docs/reference/lagratio.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,14 +128,14 @@

    Ratio of lagged observations.

    Computes the ratio of lagged observations in a vector.

    -
    lagratio(
    -  x,
    -  lag = 1L,
    -  recursion = 1L,
    -  differences = recursion,
    -  direction = c("backward", "forward"),
    -  ...
    -)
    +
    lagratio(
    +  x,
    +  lag = 1L,
    +  recursion = 1L,
    +  differences = recursion,
    +  direction = c("backward", "forward"),
    +  ...
    +)

    Arguments

    @@ -175,20 +175,31 @@

    Details

    See also

    diff

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Backward lagged ratios # no recursion -lagratio(1:10,1)
    #> [1] 2.000000 1.500000 1.333333 1.250000 1.200000 1.166667 1.142857 1.125000 -#> [9] 1.111111
    lagratio(1:10,2)
    #> [1] 3.000000 2.000000 1.666667 1.500000 1.400000 1.333333 1.285714 1.250000
    # with recursion -lagratio(1:10,1,2)
    #> [1] 0.7500000 0.8888889 0.9375000 0.9600000 0.9722222 0.9795918 0.9843750 -#> [8] 0.9876543
    lagratio(1:10,2,2)
    #> [1] 0.5555556 0.7500000 0.8400000 0.8888889 0.9183673 0.9375000
    +lagratio(1:10,1) +
    #> [1] 2.000000 1.500000 1.333333 1.250000 1.200000 1.166667 1.142857 1.125000 +#> [9] 1.111111
    lagratio(1:10,2) +
    #> [1] 3.000000 2.000000 1.666667 1.500000 1.400000 1.333333 1.285714 1.250000
    # with recursion +lagratio(1:10,1,2) +
    #> [1] 0.7500000 0.8888889 0.9375000 0.9600000 0.9722222 0.9795918 0.9843750 +#> [8] 0.9876543
    lagratio(1:10,2,2) +
    #> [1] 0.5555556 0.7500000 0.8400000 0.8888889 0.9183673 0.9375000
    ## Forward lagged ratios # no recursion -lagratio(10:1,1,direction="forward")
    #> [1] 1.111111 1.125000 1.142857 1.166667 1.200000 1.250000 1.333333 1.500000 -#> [9] 2.000000
    lagratio(10:1,2,direction="forward")
    #> [1] 1.250000 1.285714 1.333333 1.400000 1.500000 1.666667 2.000000 3.000000
    # with recursion -lagratio(10:1,1,2,direction="forward")
    #> [1] 0.9876543 0.9843750 0.9795918 0.9722222 0.9600000 0.9375000 0.8888889 -#> [8] 0.7500000
    lagratio(10:1,2,2,direction="forward")
    #> [1] 0.9375000 0.9183673 0.8888889 0.8400000 0.7500000 0.5555556
    +lagratio(10:1,1,direction="forward") +
    #> [1] 1.111111 1.125000 1.142857 1.166667 1.200000 1.250000 1.333333 1.500000 +#> [9] 2.000000
    lagratio(10:1,2,direction="forward") +
    #> [1] 1.250000 1.285714 1.333333 1.400000 1.500000 1.666667 2.000000 3.000000
    # with recursion +lagratio(10:1,1,2,direction="forward") +
    #> [1] 0.9876543 0.9843750 0.9795918 0.9722222 0.9600000 0.9375000 0.8888889 +#> [8] 0.7500000
    lagratio(10:1,2,2,direction="forward") +
    #> [1] 0.9375000 0.9183673 0.8888889 0.8400000 0.7500000 0.5555556
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/lencat.html b/docs/reference/lencat.html index 211ebf32..5c85ee9f 100644 --- a/docs/reference/lencat.html +++ b/docs/reference/lencat.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,37 +128,37 @@

    Constructs length class/category variable.

    Constructs a vector that contains the length class or category to which an individual belongs. Optionally, that vector can be appended to the original data frame.

    -
    lencat(x, ...)
    +    
    lencat(x, ...)
     
     # S3 method for default
    -lencat(
    -  x,
    -  w = 1,
    -  startcat = NULL,
    -  breaks = NULL,
    -  right = FALSE,
    -  use.names = FALSE,
    -  as.fact = use.names,
    -  droplevels = drop.levels,
    -  drop.levels = FALSE,
    -  ...
    -)
    +lencat(
    +  x,
    +  w = 1,
    +  startcat = NULL,
    +  breaks = NULL,
    +  right = FALSE,
    +  use.names = FALSE,
    +  as.fact = use.names,
    +  droplevels = drop.levels,
    +  drop.levels = FALSE,
    +  ...
    +)
     
     # S3 method for formula
    -lencat(
    -  x,
    -  data,
    -  w = 1,
    -  startcat = NULL,
    -  breaks = NULL,
    -  right = FALSE,
    -  use.names = FALSE,
    -  as.fact = use.names,
    -  droplevels = drop.levels,
    -  drop.levels = FALSE,
    -  vname = NULL,
    -  ...
    -)
    +lencat( + x, + data, + w = 1, + startcat = NULL, + breaks = NULL, + right = FALSE, + use.names = FALSE, + as.fact = use.names, + droplevels = drop.levels, + drop.levels = FALSE, + vname = NULL, + ... +)

    Arguments

    @@ -224,92 +224,107 @@

    <

    2-Data Manipulation.

    References

    -

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

    +

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

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    # Create random lengths measured to nearest 0.1 unit -df1 <- data.frame(len=round(runif(50,0.1,9.9),1)) +df1 <- data.frame(len=round(runif(50,0.1,9.9),1)) # Create length categories by 0.1 unit -df1$LCat1 <- lencat(df1$len,w=0.1) -xtabs(~LCat1,data=df1)
    #> LCat1 +df1$LCat1 <- lencat(df1$len,w=0.1) +xtabs(~LCat1,data=df1) +
    #> LCat1 #> 0.2 0.9 1.3 1.5 1.6 1.7 2.1 2.8 2.9 3 3.3 3.8 4.1 4.2 4.4 4.5 4.6 4.9 5.1 5.7 #> 1 1 2 1 1 2 1 1 2 2 1 1 1 1 1 2 1 1 2 1 #> 6.2 6.3 6.4 7.1 7.2 7.3 7.6 7.7 7.9 8.3 8.6 8.7 9.3 9.8 #> 1 2 1 2 1 2 1 1 1 5 2 2 1 2
    # length categories by 0.2 units -df1$LCat2 <- lencat(df1$len,w=0.2) -xtabs(~LCat2,data=df1)
    #> LCat2 +df1$LCat2 <- lencat(df1$len,w=0.2) +xtabs(~LCat2,data=df1) +
    #> LCat2 #> 0.2 0.8 1.2 1.4 1.6 2 2.8 3 3.2 3.8 4 4.2 4.4 4.6 4.8 5 5.6 6.2 6.4 7 #> 1 1 2 1 3 1 3 2 1 1 1 1 3 1 1 2 1 3 1 2 #> 7.2 7.6 7.8 8.2 8.6 9.2 9.8 #> 3 2 1 5 4 1 2
    # length categories by 0.2 units starting at 0.1 -df1$LCat3 <- lencat(df1$len,w=0.2,startcat=0.1) -xtabs(~LCat3,data=df1)
    #> LCat3 +df1$LCat3 <- lencat(df1$len,w=0.2,startcat=0.1) +xtabs(~LCat3,data=df1) +
    #> LCat3 #> 0.1 0.9 1.3 1.5 1.7 2.1 2.7 2.9 3.3 3.7 4.1 4.3 4.5 4.9 5.1 5.7 6.1 6.3 7.1 7.3 #> 1 1 2 2 2 1 1 4 1 1 2 1 3 1 2 1 1 3 3 2 #> 7.5 7.7 7.9 8.3 8.5 8.7 9.3 9.7 #> 1 1 1 5 2 2 1 2
    # length categories as set by breaks -df1$LCat4 <- lencat(df1$len,breaks=c(0,2,4,7,10)) -xtabs(~LCat4,data=df1)
    #> LCat4 +df1$LCat4 <- lencat(df1$len,breaks=c(0,2,4,7,10)) +xtabs(~LCat4,data=df1) +
    #> LCat4 #> 0 2 4 7 #> 8 8 14 20
    ## A Second example # random lengths measured to nearest unit -df2 <- data.frame(len=round(runif(50,10,117),0)) +df2 <- data.frame(len=round(runif(50,10,117),0)) # length categories by 5 units -df2$LCat1 <- lencat(df2$len,w=5) -xtabs(~LCat1,data=df2)
    #> LCat1 +df2$LCat1 <- lencat(df2$len,w=5) +xtabs(~LCat1,data=df2) +
    #> LCat1 #> 10 15 20 25 30 35 40 45 50 65 70 75 80 85 90 95 100 105 110 115 #> 3 4 3 2 1 1 2 2 4 3 2 1 2 2 3 4 2 4 4 1
    # length categories by 5 units starting at 7 -df2$LCat2 <- lencat(df2$len,w=5,startcat=7) -xtabs(~LCat2,data=df2)
    #> LCat2 +df2$LCat2 <- lencat(df2$len,w=5,startcat=7) +xtabs(~LCat2,data=df2) +
    #> LCat2 #> 7 12 17 22 27 32 37 42 47 52 62 67 72 77 82 87 92 97 102 107 #> 2 2 5 1 2 1 1 3 3 2 2 1 2 1 3 1 5 2 3 6 #> 112 #> 2
    # length categories by 10 units -df2$LCat3 <- lencat(df2$len,w=10) -xtabs(~LCat3,data=df2)
    #> LCat3 +df2$LCat3 <- lencat(df2$len,w=10) +xtabs(~LCat3,data=df2) +
    #> LCat3 #> 10 20 30 40 50 60 70 80 90 100 110 #> 7 5 2 4 4 3 3 4 7 6 5
    # length categories by 10 units starting at 5 -df2$LCat4 <- lencat(df2$len,w=10,startcat=5) -xtabs(~LCat4,data=df2)
    #> LCat4 +df2$LCat4 <- lencat(df2$len,w=10,startcat=5) +xtabs(~LCat4,data=df2) +
    #> LCat4 #> 5 15 25 35 45 65 75 85 95 105 115 #> 3 7 3 3 6 5 3 5 6 8 1
    # length categories as set by breaks -df2$LCat5 <- lencat(df2$len,breaks=c(5,50,75,150)) -xtabs(~LCat5,data=df2)
    #> LCat5 +df2$LCat5 <- lencat(df2$len,breaks=c(5,50,75,150)) +xtabs(~LCat5,data=df2) +
    #> LCat5 #> 5 50 75 #> 18 9 23
    ## A Third example # random lengths measured to nearest 0.1 unit -df3 <- data.frame(len=round(runif(50,10,117),1)) +df3 <- data.frame(len=round(runif(50,10,117),1)) # length categories by 5 units -df3$LCat1 <- lencat(df3$len,w=5) -xtabs(~LCat1,data=df3)
    #> LCat1 +df3$LCat1 <- lencat(df3$len,w=5) +xtabs(~LCat1,data=df3) +
    #> LCat1 #> 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 #> 1 1 1 1 1 2 6 3 1 1 7 3 3 2 2 5 1 5 1 3
    ## A Fourth example # random lengths measured to nearest 0.01 unit -df4 <- data.frame(len=round(runif(50,0.1,9.9),2)) +df4 <- data.frame(len=round(runif(50,0.1,9.9),2)) # length categories by 0.1 unit -df4$LCat1 <- lencat(df4$len,w=0.1) -xtabs(~LCat1,data=df4)
    #> LCat1 +df4$LCat1 <- lencat(df4$len,w=0.1) +xtabs(~LCat1,data=df4) +
    #> LCat1 #> 0.1 0.7 1.2 1.8 2 2.2 2.3 2.7 2.9 3 3.1 3.2 3.3 3.4 3.6 3.9 4 4.2 4.3 4.4 #> 1 1 2 1 1 1 1 2 1 1 1 1 1 2 1 3 1 1 2 1 #> 4.5 4.7 4.8 5 5.1 5.3 5.6 6.1 6.4 6.6 6.7 6.8 7.4 7.7 8.2 8.4 8.8 8.9 #> 2 2 1 1 1 1 3 1 1 1 2 1 1 1 1 1 2 1
    # length categories by 0.1 unit, but without missing categories -df4$LCat2 <- lencat(df4$len,w=0.1,as.fact=TRUE) -xtabs(~LCat2,data=df4)
    #> LCat2 +df4$LCat2 <- lencat(df4$len,w=0.1,as.fact=TRUE) +xtabs(~LCat2,data=df4) +
    #> LCat2 #> 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 #> 1 0 0 0 0 0 1 0 0 0 0 2 0 0 0 0 0 1 0 1 #> 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4 @@ -321,67 +336,77 @@

    Examp #> 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 #> 0 1 0 1 0 0 0 2 1

    # length categories by 2 unit -df4$LCat3 <- lencat(df4$len,w=2) -xtabs(~LCat3,data=df4)
    #> LCat3 +df4$LCat3 <- lencat(df4$len,w=2) +xtabs(~LCat3,data=df4) +
    #> LCat3 #> 0 2 4 6 8 #> 5 16 16 8 5
    ## A Fifth example -- with real data # remove variables with "anu" and "radcap" just for simplicity -smb1 <- smb2 <- SMBassWB[,-c(8:20)] +smb1 <- smb2 <- SMBassWB[,-c(8:20)] # 10 mm length classes - in default LCat variable -smb1$LCat10 <- lencat(smb1$lencap,w=10) -head(smb1)
    #> species lake gear yearcap fish agecap lencap LCat10 +smb1$LCat10 <- lencat(smb1$lencap,w=10) +head(smb1) +
    #> species lake gear yearcap fish agecap lencap LCat10 #> 1 SMB WB E 1988 5 1 71 70 #> 2 SMB WB E 1988 3 1 64 60 #> 3 SMB WB E 1988 2 1 57 50 #> 4 SMB WB E 1988 4 1 68 60 #> 5 SMB WB E 1988 6 1 72 70 -#> 6 SMB WB E 1988 7 1 80 80
    xtabs(~LCat10,data=smb1)
    #> LCat10 +#> 6 SMB WB E 1988 7 1 80 80
    xtabs(~LCat10,data=smb1) +
    #> LCat10 #> 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 #> 3 4 7 5 7 20 21 23 23 23 35 22 7 12 21 21 23 15 19 18 #> 250 260 270 280 290 300 310 320 330 340 360 440 #> 19 23 17 22 17 4 4 4 2 1 2 1
    # Same as previous but returned as factor so levels with no fish still seen -smb1$LCat10A <- lencat(smb1$lencap,w=10,as.fact=TRUE) -head(smb1)
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A +smb1$LCat10A <- lencat(smb1$lencap,w=10,as.fact=TRUE) +head(smb1) +
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A #> 1 SMB WB E 1988 5 1 71 70 70 #> 2 SMB WB E 1988 3 1 64 60 60 #> 3 SMB WB E 1988 2 1 57 50 50 #> 4 SMB WB E 1988 4 1 68 60 60 #> 5 SMB WB E 1988 6 1 72 70 70 -#> 6 SMB WB E 1988 7 1 80 80 80
    xtabs(~LCat10A,data=smb1)
    #> LCat10A +#> 6 SMB WB E 1988 7 1 80 80 80
    xtabs(~LCat10A,data=smb1) +
    #> LCat10A #> 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 #> 3 4 7 5 7 20 21 23 23 23 35 22 7 12 21 21 23 15 19 18 #> 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 #> 19 23 17 22 17 4 4 4 2 1 0 2 0 0 0 0 0 0 0 1
    # Same as previous but returned as a factor with unused levels dropped -smb1$LCat10B <- lencat(smb1$lencap,w=10,as.fact=TRUE,droplevels=TRUE) -head(smb1)
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A LCat10B +smb1$LCat10B <- lencat(smb1$lencap,w=10,as.fact=TRUE,droplevels=TRUE) +head(smb1) +
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A LCat10B #> 1 SMB WB E 1988 5 1 71 70 70 70 #> 2 SMB WB E 1988 3 1 64 60 60 60 #> 3 SMB WB E 1988 2 1 57 50 50 50 #> 4 SMB WB E 1988 4 1 68 60 60 60 #> 5 SMB WB E 1988 6 1 72 70 70 70 -#> 6 SMB WB E 1988 7 1 80 80 80 80
    xtabs(~LCat10B,data=smb1)
    #> LCat10B +#> 6 SMB WB E 1988 7 1 80 80 80 80
    xtabs(~LCat10B,data=smb1) +
    #> LCat10B #> 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 #> 3 4 7 5 7 20 21 23 23 23 35 22 7 12 21 21 23 15 19 18 #> 250 260 270 280 290 300 310 320 330 340 360 440 #> 19 23 17 22 17 4 4 4 2 1 2 1
    # 25 mm length classes - in custom variable name -smb1$LCat25 <- lencat(smb1$lencap,w=25) -head(smb1)
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A LCat10B LCat25 +smb1$LCat25 <- lencat(smb1$lencap,w=25) +head(smb1) +
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A LCat10B LCat25 #> 1 SMB WB E 1988 5 1 71 70 70 70 50 #> 2 SMB WB E 1988 3 1 64 60 60 60 50 #> 3 SMB WB E 1988 2 1 57 50 50 50 50 #> 4 SMB WB E 1988 4 1 68 60 60 60 50 #> 5 SMB WB E 1988 6 1 72 70 70 70 50 -#> 6 SMB WB E 1988 7 1 80 80 80 80 75
    xtabs(~LCat25,data=smb1)
    #> LCat25 +#> 6 SMB WB E 1988 7 1 80 80 80 80 75
    xtabs(~LCat25,data=smb1) +
    #> LCat25 #> 50 75 100 125 150 175 200 225 250 275 300 325 350 425 #> 12 14 52 58 60 37 51 45 48 50 9 6 2 1
    # using values from psdVal for Smallmouth Bass -smb1$PSDCat1 <- lencat(smb1$lencap,breaks=psdVal("Smallmouth Bass")) -head(smb1)
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A LCat10B LCat25 +smb1$PSDCat1 <- lencat(smb1$lencap,breaks=psdVal("Smallmouth Bass")) +head(smb1) +
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A LCat10B LCat25 #> 1 SMB WB E 1988 5 1 71 70 70 70 50 #> 2 SMB WB E 1988 3 1 64 60 60 60 50 #> 3 SMB WB E 1988 2 1 57 50 50 50 50 @@ -394,12 +419,14 @@

    Examp #> 3 0 #> 4 0 #> 5 0 -#> 6 0

    xtabs(~PSDCat1,data=smb1)
    #> PSDCat1 +#> 6 0
    xtabs(~PSDCat1,data=smb1) +
    #> PSDCat1 #> 0 180 280 350 430 #> 200 188 54 2 1
    # add category names -smb1$PSDCat2 <- lencat(smb1$lencap,breaks=psdVal("Smallmouth Bass"),use.names=TRUE) -head(smb1)
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A LCat10B LCat25 +smb1$PSDCat2 <- lencat(smb1$lencap,breaks=psdVal("Smallmouth Bass"),use.names=TRUE) +head(smb1) +
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A LCat10B LCat25 #> 1 SMB WB E 1988 5 1 71 70 70 70 50 #> 2 SMB WB E 1988 3 1 64 60 60 60 50 #> 3 SMB WB E 1988 2 1 57 50 50 50 50 @@ -412,13 +439,15 @@

    Examp #> 3 0 substock #> 4 0 substock #> 5 0 substock -#> 6 0 substock

    xtabs(~PSDCat2,data=smb1)
    #> PSDCat2 +#> 6 0 substock
    xtabs(~PSDCat2,data=smb1) +
    #> PSDCat2 #> substock stock quality preferred memorable trophy #> 200 188 54 2 1 0
    # same as above but drop the unused levels -smb1$PSDCat2A <- lencat(smb1$lencap,breaks=psdVal("Smallmouth Bass"), - use.names=TRUE,droplevels=TRUE) -head(smb1)
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A LCat10B LCat25 +smb1$PSDCat2A <- lencat(smb1$lencap,breaks=psdVal("Smallmouth Bass"), + use.names=TRUE,droplevels=TRUE) +head(smb1) +
    #> species lake gear yearcap fish agecap lencap LCat10 LCat10A LCat10B LCat25 #> 1 SMB WB E 1988 5 1 71 70 70 70 50 #> 2 SMB WB E 1988 3 1 64 60 60 60 50 #> 3 SMB WB E 1988 2 1 57 50 50 50 50 @@ -431,9 +460,11 @@

    Examp #> 3 0 substock substock #> 4 0 substock substock #> 5 0 substock substock -#> 6 0 substock substock

    xtabs(~PSDCat2A,data=smb1)
    #> PSDCat2A +#> 6 0 substock substock
    xtabs(~PSDCat2A,data=smb1) +
    #> PSDCat2A #> substock stock quality preferred memorable -#> 200 188 54 2 1
    str(smb1)
    #> 'data.frame': 445 obs. of 14 variables: +#> 200 188 54 2 1
    str(smb1) +
    #> 'data.frame': 445 obs. of 14 variables: #> $ species : Factor w/ 1 level "SMB": 1 1 1 1 1 1 1 1 1 1 ... #> $ lake : Factor w/ 1 level "WB": 1 1 1 1 1 1 1 1 1 1 ... #> $ gear : Factor w/ 2 levels "E","T": 1 1 1 1 1 1 1 1 1 1 ... @@ -449,9 +480,10 @@

    Examp #> $ PSDCat2 : Factor w/ 6 levels "substock","stock",..: 1 1 1 1 1 1 1 1 1 1 ... #> $ PSDCat2A: Factor w/ 5 levels "substock","stock",..: 1 1 1 1 1 1 1 1 1 1 ...

    # same as above but not returned as a factor (returned as a character) -smb1$PSDcat2B <- lencat(smb1$lencap,breaks=psdVal("Smallmouth Bass"), - use.names=TRUE,as.fact=FALSE) -str(smb1)
    #> 'data.frame': 445 obs. of 15 variables: +smb1$PSDcat2B <- lencat(smb1$lencap,breaks=psdVal("Smallmouth Bass"), + use.names=TRUE,as.fact=FALSE) +str(smb1) +
    #> 'data.frame': 445 obs. of 15 variables: #> $ species : Factor w/ 1 level "SMB": 1 1 1 1 1 1 1 1 1 1 ... #> $ lake : Factor w/ 1 level "WB": 1 1 1 1 1 1 1 1 1 1 ... #> $ gear : Factor w/ 2 levels "E","T": 1 1 1 1 1 1 1 1 1 1 ... @@ -469,8 +501,9 @@

    Examp #> $ PSDcat2B: chr "substock" "substock" "substock" "substock" ...

    ## A Sixth example -- similar to fifth example but using the formula notation # 10 mm length classes - in default LCat variable -smb2 <- lencat(~lencap,data=smb2,w=10) -head(smb2)
    #> species lake gear yearcap fish agecap lencap LCat +smb2 <- lencat(~lencap,data=smb2,w=10) +head(smb2) +
    #> species lake gear yearcap fish agecap lencap LCat #> 1 SMB WB E 1988 5 1 71 70 #> 2 SMB WB E 1988 3 1 64 60 #> 3 SMB WB E 1988 2 1 57 50 @@ -478,8 +511,9 @@

    Examp #> 5 SMB WB E 1988 6 1 72 70 #> 6 SMB WB E 1988 7 1 80 80

    # 25 mm length classes - in custom variable name -smb2 <- lencat(~lencap,data=smb2,w=25,vname="LenCat25") -head(smb2)
    #> species lake gear yearcap fish agecap lencap LCat LenCat25 +smb2 <- lencat(~lencap,data=smb2,w=25,vname="LenCat25") +head(smb2) +
    #> species lake gear yearcap fish agecap lencap LCat LenCat25 #> 1 SMB WB E 1988 5 1 71 70 50 #> 2 SMB WB E 1988 3 1 64 60 50 #> 3 SMB WB E 1988 2 1 57 50 50 @@ -487,8 +521,9 @@

    Examp #> 5 SMB WB E 1988 6 1 72 70 50 #> 6 SMB WB E 1988 7 1 80 80 75

    # using values from psdVal for Smallmouth Bass -smb2 <- lencat(~lencap,data=smb2,breaks=psdVal("Smallmouth Bass"),vname="LenPsd") -head(smb2)
    #> species lake gear yearcap fish agecap lencap LCat LenCat25 LenPsd +smb2 <- lencat(~lencap,data=smb2,breaks=psdVal("Smallmouth Bass"),vname="LenPsd") +head(smb2) +
    #> species lake gear yearcap fish agecap lencap LCat LenCat25 LenPsd #> 1 SMB WB E 1988 5 1 71 70 50 0 #> 2 SMB WB E 1988 3 1 64 60 50 0 #> 3 SMB WB E 1988 2 1 57 50 50 0 @@ -496,15 +531,17 @@

    Examp #> 5 SMB WB E 1988 6 1 72 70 50 0 #> 6 SMB WB E 1988 7 1 80 80 75 0

    # add category names -smb2 <- lencat(~lencap,data=smb2,breaks=psdVal("Smallmouth Bass"),vname="LenPsd2", - use.names=TRUE,droplevels=TRUE) -head(smb2)
    #> species lake gear yearcap fish agecap lencap LCat LenCat25 LenPsd LenPsd2 +smb2 <- lencat(~lencap,data=smb2,breaks=psdVal("Smallmouth Bass"),vname="LenPsd2", + use.names=TRUE,droplevels=TRUE) +head(smb2) +
    #> species lake gear yearcap fish agecap lencap LCat LenCat25 LenPsd LenPsd2 #> 1 SMB WB E 1988 5 1 71 70 50 0 substock #> 2 SMB WB E 1988 3 1 64 60 50 0 substock #> 3 SMB WB E 1988 2 1 57 50 50 0 substock #> 4 SMB WB E 1988 4 1 68 60 50 0 substock #> 5 SMB WB E 1988 6 1 72 70 50 0 substock -#> 6 SMB WB E 1988 7 1 80 80 75 0 substock
    str(smb2)
    #> 'data.frame': 445 obs. of 11 variables: +#> 6 SMB WB E 1988 7 1 80 80 75 0 substock
    str(smb2) +
    #> 'data.frame': 445 obs. of 11 variables: #> $ species : Factor w/ 1 level "SMB": 1 1 1 1 1 1 1 1 1 1 ... #> $ lake : Factor w/ 1 level "WB": 1 1 1 1 1 1 1 1 1 1 ... #> $ gear : Factor w/ 2 levels "E","T": 1 1 1 1 1 1 1 1 1 1 ... @@ -532,7 +569,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/logbtcf.html b/docs/reference/logbtcf.html index 523a114f..e2efea9d 100644 --- a/docs/reference/logbtcf.html +++ b/docs/reference/logbtcf.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Constructs the correction-factor used when back-transforming log-transformed

    Constructs the correction-factor used when back-transforming log-transformed values according to Sprugel (1983). Sprugel's main formula -- exp((syx^2)/2) -- is used when syx is estimated for natural log transformed data. A correction for any base is obtained by multiplying the syx term by log_e(base) to give exp(((log_e(base)*syx)^2)/2). This more general formula is implemented here (if, of course, the base is exp(1) then the general formula reduces to the original specific formula).

    -
    logbtcf(obj, base = exp(1))
    +
    logbtcf(obj, base = exp(1))

    Arguments

    @@ -149,29 +149,40 @@

    Value

    References

    Sprugel, D.G. 1983. Correcting for bias in log-transformed allometric equations. Ecology 64:209-210.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    # toy data -df <- data.frame(y=rlnorm(10),x=rlnorm(10)) -df$logey <- log(df$y) -df$log10y <- log10(df$y) -df$logex <- log(df$x) -df$log10x <- log10(df$x) +df <- data.frame(y=rlnorm(10),x=rlnorm(10)) +df$logey <- log(df$y) +df$log10y <- log10(df$y) +df$logex <- log(df$x) +df$log10x <- log10(df$x) # model and predictions on loge scale -lme <- lm(logey~logex,data=df) -( ploge <- predict(lme,data.frame(logex=log(10))) )
    #> 1 -#> 1.691612
    ( pe <- exp(ploge) )
    #> 1 -#> 5.428224
    ( cfe <- logbtcf(lme) )
    #> [1] 1.381993
    ( cpe <- cfe*pe )
    #> 1 +lme <- lm(logey~logex,data=df) +( ploge <- predict(lme,data.frame(logex=log(10))) ) +
    #> 1 +#> 1.691612
    ( pe <- exp(ploge) ) +
    #> 1 +#> 5.428224
    ( cfe <- logbtcf(lme) ) +
    #> [1] 1.381993
    ( cpe <- cfe*pe ) +
    #> 1 #> 7.501769
    # model and predictions on log10 scale -lm10 <- lm(log10y~log10x,data=df) -plog10 <- predict(lm10,data.frame(log10x=log10(10))) -p10 <- 10^(plog10) -( cf10 <- logbtcf(lm10,10) )
    #> [1] 1.381993
    ( cp10 <- cf10*p10 )
    #> 1 +lm10 <- lm(log10y~log10x,data=df) +plog10 <- predict(lm10,data.frame(log10x=log10(10))) +p10 <- 10^(plog10) +( cf10 <- logbtcf(lm10,10) ) +
    #> [1] 1.381993
    ( cp10 <- cf10*p10 ) +
    #> 1 #> 7.501769
    # cfe and cf10, cpe and cp10 should be equal -all.equal(cfe,cf10)
    #> [1] TRUE
    all.equal(cpe,cp10)
    #> [1] TRUE
    +all.equal(cfe,cf10) +
    #> [1] TRUE
    all.equal(cpe,cp10) +
    #> [1] TRUE
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/lwCompPreds-1.png b/docs/reference/lwCompPreds-1.png index 895e70e4..ded70aef 100644 Binary files a/docs/reference/lwCompPreds-1.png and b/docs/reference/lwCompPreds-1.png differ diff --git a/docs/reference/lwCompPreds-10.png b/docs/reference/lwCompPreds-10.png index 895e70e4..ded70aef 100644 Binary files a/docs/reference/lwCompPreds-10.png and b/docs/reference/lwCompPreds-10.png differ diff --git a/docs/reference/lwCompPreds-2.png b/docs/reference/lwCompPreds-2.png index 76c5e5f9..c5c403e0 100644 Binary files a/docs/reference/lwCompPreds-2.png and b/docs/reference/lwCompPreds-2.png differ diff --git a/docs/reference/lwCompPreds-3.png b/docs/reference/lwCompPreds-3.png index b38c2c13..e495e29f 100644 Binary files a/docs/reference/lwCompPreds-3.png and b/docs/reference/lwCompPreds-3.png differ diff --git a/docs/reference/lwCompPreds-4.png b/docs/reference/lwCompPreds-4.png index aae609ea..aa99b43d 100644 Binary files a/docs/reference/lwCompPreds-4.png and b/docs/reference/lwCompPreds-4.png differ diff --git a/docs/reference/lwCompPreds-5.png b/docs/reference/lwCompPreds-5.png index 4a305c29..bbc52721 100644 Binary files a/docs/reference/lwCompPreds-5.png and b/docs/reference/lwCompPreds-5.png differ diff --git a/docs/reference/lwCompPreds-6.png b/docs/reference/lwCompPreds-6.png index 691dc831..83feab69 100644 Binary files a/docs/reference/lwCompPreds-6.png and b/docs/reference/lwCompPreds-6.png differ diff --git a/docs/reference/lwCompPreds-7.png b/docs/reference/lwCompPreds-7.png index 09eb972c..432122d4 100644 Binary files a/docs/reference/lwCompPreds-7.png and b/docs/reference/lwCompPreds-7.png differ diff --git a/docs/reference/lwCompPreds-8.png b/docs/reference/lwCompPreds-8.png index 895e70e4..ded70aef 100644 Binary files a/docs/reference/lwCompPreds-8.png and b/docs/reference/lwCompPreds-8.png differ diff --git a/docs/reference/lwCompPreds-9.png b/docs/reference/lwCompPreds-9.png index b38c2c13..e495e29f 100644 Binary files a/docs/reference/lwCompPreds-9.png and b/docs/reference/lwCompPreds-9.png differ diff --git a/docs/reference/lwCompPreds.html b/docs/reference/lwCompPreds.html index 57792f5a..4a174fdc 100644 --- a/docs/reference/lwCompPreds.html +++ b/docs/reference/lwCompPreds.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,27 +128,27 @@

    Constructs plots of predicted weights at given lengths among different group

    Constructs plots of predicted weights at given lengths among different groups. These plots allow the user to explore differences in predicted weights at a variety of lengths when the weight-length relationship is not the same across a variety of groups.

    -
    lwCompPreds(
    -  object,
    -  lens = NULL,
    -  qlens = c(0.05, 0.25, 0.5, 0.75, 0.95),
    -  qlens.dec = 1,
    -  base = exp(1),
    -  interval = c("confidence", "prediction", "both"),
    -  center.value = 0,
    -  lwd = 1,
    -  connect.preds = TRUE,
    -  show.preds = FALSE,
    -  col.connect = "gray50",
    -  ylim = NULL,
    -  main.pre = "Length==",
    -  cex.main = 0.8,
    -  xlab = "Groups",
    -  ylab = "Predicted Weight",
    -  yaxs = "r",
    -  rows = round(sqrt(num)),
    -  cols = ceiling(sqrt(num))
    -)
    +
    lwCompPreds(
    +  object,
    +  lens = NULL,
    +  qlens = c(0.05, 0.25, 0.5, 0.75, 0.95),
    +  qlens.dec = 1,
    +  base = exp(1),
    +  interval = c("confidence", "prediction", "both"),
    +  center.value = 0,
    +  lwd = 1,
    +  connect.preds = TRUE,
    +  show.preds = FALSE,
    +  col.connect = "gray50",
    +  ylim = NULL,
    +  main.pre = "Length==",
    +  cex.main = 0.8,
    +  xlab = "Groups",
    +  ylab = "Predicted Weight",
    +  yaxs = "r",
    +  rows = round(sqrt(num)),
    +  cols = ceiling(sqrt(num))
    +)

    Arguments

    @@ -239,15 +239,19 @@

    <

    7-Weight-Length.

    References

    -

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

    +

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

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    # add log length and weight data to ChinookArg data -ChinookArg$logtl <- log(ChinookArg$tl) -ChinookArg$logwt <- log(ChinookArg$w) +ChinookArg$logtl <- log(ChinookArg$tl) +ChinookArg$logwt <- log(ChinookArg$w) # fit model to assess equality of slopes -lm1 <- lm(logwt~logtl*loc,data=ChinookArg) -anova(lm1)
    #> Analysis of Variance Table +lm1 <- lm(logwt~logtl*loc,data=ChinookArg) +anova(lm1) +
    #> Analysis of Variance Table #> #> Response: logwt #> Df Sum Sq Mean Sq F value Pr(>F) @@ -258,36 +262,48 @@

    Examp #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    # set graphing parameters so that the plots will look decent -op <- par(mar=c(3.5,3.5,1,1),mgp=c(1.8,0.4,0),tcl=-0.2) +op <- par(mar=c(3.5,3.5,1,1),mgp=c(1.8,0.4,0),tcl=-0.2) # show predicted weights (w/ CI) at the default quantile lengths for each year -lwCompPreds(lm1,xlab="Location")
    # show predicted weights (w/ CI) at the quartile lengths for each year -lwCompPreds(lm1,xlab="Location",qlens=c(0.25,0.5,0.75))
    # show predicted weights (w/ CI) at certain lengths for each year -lwCompPreds(lm1,xlab="Location",lens=c(60,90,120,150))
    # show predicted weights (w/ just PI) at certain lengths for each year -lwCompPreds(lm1,xlab="Location",lens=c(60,90,120,150),interval="prediction")
    # show predicted weights (w/ CI and PI) at certain lengths for each year -lwCompPreds(lm1,xlab="Location",lens=c(60,90,120,150),interval="both")
    # show predicted weights (w/ CI and points at the prediction) at certain lengths for each year -lwCompPreds(lm1,xlab="Location",lens=c(60,90,120,150),show.preds=TRUE)
    # show predicted weights (w/ CI but don't connect means) at certain lengths for each year -lwCompPreds(lm1,xlab="Location",lens=c(60,90,120,150),connect.preds=FALSE,show.preds=TRUE)
    +lwCompPreds(lm1,xlab="Location") +
    # show predicted weights (w/ CI) at the quartile lengths for each year +lwCompPreds(lm1,xlab="Location",qlens=c(0.25,0.5,0.75)) +
    # show predicted weights (w/ CI) at certain lengths for each year +lwCompPreds(lm1,xlab="Location",lens=c(60,90,120,150)) +
    # show predicted weights (w/ just PI) at certain lengths for each year +lwCompPreds(lm1,xlab="Location",lens=c(60,90,120,150),interval="prediction") +
    # show predicted weights (w/ CI and PI) at certain lengths for each year +lwCompPreds(lm1,xlab="Location",lens=c(60,90,120,150),interval="both") +
    # show predicted weights (w/ CI and points at the prediction) at certain lengths for each year +lwCompPreds(lm1,xlab="Location",lens=c(60,90,120,150),show.preds=TRUE) +
    # show predicted weights (w/ CI but don't connect means) at certain lengths for each year +lwCompPreds(lm1,xlab="Location",lens=c(60,90,120,150),connect.preds=FALSE,show.preds=TRUE) +
    # fit model with centered data -mn.logtl <- mean(ChinookArg$logtl,na.rm=TRUE) -ChinookArg$clogtl <- ChinookArg$logtl-mn.logtl -lm2 <- lm(logwt~clogtl*loc,data=ChinookArg) -lwCompPreds(lm2,xlab="Location",center.value=mn.logtl)
    lwCompPreds(lm2,xlab="Location",lens=c(60,90,120,150),center.value=mn.logtl)
    +mn.logtl <- mean(ChinookArg$logtl,na.rm=TRUE) +ChinookArg$clogtl <- ChinookArg$logtl-mn.logtl +lm2 <- lm(logwt~clogtl*loc,data=ChinookArg) +lwCompPreds(lm2,xlab="Location",center.value=mn.logtl) +
    lwCompPreds(lm2,xlab="Location",lens=c(60,90,120,150),center.value=mn.logtl) +
    # fit model with a different base (plot should be the same as the first example) -ChinookArg$logtl <- log10(ChinookArg$tl) -ChinookArg$logwt <- log10(ChinookArg$w) -lm1 <- lm(logwt~logtl*loc,data=ChinookArg) -lwCompPreds(lm1,base=10,xlab="Location")
    -if (interactive()) { +ChinookArg$logtl <- log10(ChinookArg$tl) +ChinookArg$logwt <- log10(ChinookArg$w) +lm1 <- lm(logwt~logtl*loc,data=ChinookArg) +lwCompPreds(lm1,base=10,xlab="Location") +
    +if (interactive()) { # should give error, does not work for only a simple linear regression - lm2 <- lm(logwt~logtl,data=ChinookArg) - lwCompPreds(lm2) + lm2 <- lm(logwt~logtl,data=ChinookArg) + lwCompPreds(lm2) # or a one-way ANOVA - lm3 <- lm(logwt~loc,data=ChinookArg) - lwCompPreds(lm3) -} + lm3 <- lm(logwt~loc,data=ChinookArg) + lwCompPreds(lm3) +} ## return graphing parameters to original state -par(op)
    +par(op) + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/mapvalues.html b/docs/reference/mapvalues.html index 849fc3ea..67a52c2d 100644 --- a/docs/reference/mapvalues.html +++ b/docs/reference/mapvalues.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -146,7 +146,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/metaM.html b/docs/reference/metaM.html index a81b7714..ab5c0bc3 100644 --- a/docs/reference/metaM.html +++ b/docs/reference/metaM.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,24 +128,24 @@

    Estimate natural mortality from a variety of empirical methods.

    Several methods can be used to estimated natural mortality (M) from other types of data, including parameters from the von Bertalanffy growth equation, maximum age, and temperature. These relationships have been developed from meta-analyses of a large number of populations. Several of these methods are implemented in this function.

    -
    Mmethods(what = c("all", "tmax", "K", "Hoenig", "Pauly"))
    -
    -metaM(
    -  method = Mmethods(),
    -  justM = TRUE,
    -  tmax = NULL,
    -  K = NULL,
    -  Linf = NULL,
    -  t0 = NULL,
    -  b = NULL,
    -  L = NULL,
    -  Temp = NULL,
    -  t50 = NULL,
    -  Winf = NULL
    -)
    +    
    Mmethods(what = c("all", "tmax", "K", "Hoenig", "Pauly"))
    +
    +metaM(
    +  method = Mmethods(),
    +  justM = TRUE,
    +  tmax = NULL,
    +  K = NULL,
    +  Linf = NULL,
    +  t0 = NULL,
    +  b = NULL,
    +  L = NULL,
    +  Temp = NULL,
    +  t50 = NULL,
    +  Winf = NULL
    +)
     
     # S3 method for metaM
    -print(x, digits = 4, ...)
    +print(x, digits = 4, ...)

    Arguments

    @@ -255,7 +255,7 @@

    <

    11-Mortality.

    References

    -

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

    +

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

    Alverson, D.L. and M.J. Carney. 1975. A graphic review of the growth and decay of population cohorts. Journal du Conseil International pour l'Exploration de la Mer. 36:133-143.

    Charnov, E.L., H. Gislason, and J.G. Pope. 2013. Evolutionary assembly rules for fish life histories. Fish and Fisheries. 14:213-224.

    Gislason, H., N. Daan, J.C. Rice, and J.G. Pope. 2010. Size, growth, temperature and the natural mortality of marine fish. Fish and Fisheries 11:149-158.

    @@ -271,32 +271,49 @@

    R

    See also

    See M.empirical in fishmethods for similar functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## List names for available methods -Mmethods()
    #> [1] "HoenigNLS" "HoenigO" "HoenigOF" "HoenigOM" +Mmethods() +
    #> [1] "HoenigNLS" "HoenigO" "HoenigOF" "HoenigOM" #> [5] "HoenigOC" "HoenigO2" "HoenigO2F" "HoenigO2M" #> [9] "HoenigO2C" "HoenigLM" "HewittHoenig" "tmax1" #> [13] "PaulyLNoT" "PaulyL" "PaulyW" "K1" #> [17] "K2" "JensenK1" "JensenK2" "Gislason" #> [21] "AlversonCarney" "Charnov" "ZhangMegreyD" "ZhangMegreyP" -#> [25] "RikhterEfanov1" "RikhterEfanov2"
    Mmethods("tmax")
    #> [1] "tmax1" "HoenigNLS" "HoenigO" "HoenigOF" "HoenigOM" +#> [25] "RikhterEfanov1" "RikhterEfanov2"
    Mmethods("tmax") +
    #> [1] "tmax1" "HoenigNLS" "HoenigO" "HoenigOF" "HoenigOM" #> [6] "HoenigOC" "HoenigO2" "HoenigO2F" "HoenigO2M" "HoenigO2C" #> [11] "HoenigLM" "HewittHoenig"
    ## Simple Examples -metaM("tmax",tmax=20)
    #> [1] 0.25545
    metaM("tmax",tmax=20,justM=FALSE)
    #> M=0.2554 as estimated with Then et al. (2015) tmax equation
    #> with givens: tmax=20
    metaM("HoenigNLS",tmax=20)
    #> [1] 0.3150387
    metaM("HoenigNLS",tmax=20,justM=FALSE)
    #> M=0.315 as estimated with Then et al. (2015) Hoenig (NLS) equation
    #> with givens: tmax=20
    +metaM("tmax",tmax=20) +
    #> [1] 0.25545
    metaM("tmax",tmax=20,justM=FALSE) +
    #> M=0.2554 as estimated with Then et al. (2015) tmax equation
    #> with givens: tmax=20
    metaM("HoenigNLS",tmax=20) +
    #> [1] 0.3150387
    metaM("HoenigNLS",tmax=20,justM=FALSE) +
    #> M=0.315 as estimated with Then et al. (2015) Hoenig (NLS) equation
    #> with givens: tmax=20
    ## Example Patagonian Sprat ... from Table 2 in Cerna et al. (2014) ## http://www.scielo.cl/pdf/lajar/v42n3/art15.pdf -Temp <- 11 -Linf <- 17.71 -K <- 0.78 -t0 <- -0.46 -tmax <- t0+3/K -t50 <- t0-(1/K)*log(1-13.5/Linf) -metaM("RikhterEfanov1",t50=t50)
    #> [1] 1.050009
    metaM("PaulyL",K=K,Linf=Linf,Temp=Temp)
    #> [1] 1.14058
    metaM("PaulyL",K=K,Linf=Linf,Temp=Temp,justM=FALSE)
    #> M=1.1406 as estimated with Pauly (1980) length equation
    #> with givens: K=0.78, Linf=17.71, Temp=11
    metaM("HoenigNLS",tmax=tmax)
    #> [1] 1.602862
    metaM("HoenigO",tmax=tmax)
    #> [1] 1.274125
    metaM("HewittHoenig",tmax=tmax)
    #> [1] 1.246252
    metaM("AlversonCarney",K=K,tmax=tmax)
    #> [1] 1.35398
    +Temp <- 11 +Linf <- 17.71 +K <- 0.78 +t0 <- -0.46 +tmax <- t0+3/K +t50 <- t0-(1/K)*log(1-13.5/Linf) +metaM("RikhterEfanov1",t50=t50) +
    #> [1] 1.050009
    metaM("PaulyL",K=K,Linf=Linf,Temp=Temp) +
    #> [1] 1.14058
    metaM("PaulyL",K=K,Linf=Linf,Temp=Temp,justM=FALSE) +
    #> M=1.1406 as estimated with Pauly (1980) length equation
    #> with givens: K=0.78, Linf=17.71, Temp=11
    metaM("HoenigNLS",tmax=tmax) +
    #> [1] 1.602862
    metaM("HoenigO",tmax=tmax) +
    #> [1] 1.274125
    metaM("HewittHoenig",tmax=tmax) +
    #> [1] 1.246252
    metaM("AlversonCarney",K=K,tmax=tmax) +
    #> [1] 1.35398
    ## Example of multiple calculations -metaM(c("RikhterEfanov1","PaulyL","HoenigO","HewittHoenig","AlversonCarney"), - K=K,Linf=Linf,Temp=Temp,tmax=tmax,t50=t50)
    #> method M +metaM(c("RikhterEfanov1","PaulyL","HoenigO","HewittHoenig","AlversonCarney"), + K=K,Linf=Linf,Temp=Temp,tmax=tmax,t50=t50) +
    #> method M #> 1 RikhterEfanov1 1.050009 #> 2 PaulyL 1.140580 #> 3 HoenigO 1.274125 @@ -304,7 +321,8 @@

    Examp #> 5 AlversonCarney 1.353980

    ## Example of multiple methods using Mmethods # select some methods -metaM(Mmethods()[-c(15,20,22:24,26)],K=K,Linf=Linf,Temp=Temp,tmax=tmax,t50=t50)
    #> method M +metaM(Mmethods()[-c(15,20,22:24,26)],K=K,Linf=Linf,Temp=Temp,tmax=tmax,t50=t50) +
    #> method M #> 1 HoenigNLS 1.6028619 #> 2 HoenigO 1.2741252 #> 3 HoenigOF 1.2562214 @@ -325,7 +343,8 @@

    Examp #> 18 JensenK2 1.3566000 #> 19 AlversonCarney 1.3539801 #> 20 RikhterEfanov1 1.0500095

    # select just the Hoenig methods -metaM(Mmethods("Hoenig"),K=K,Linf=Linf,Temp=Temp,tmax=tmax,t50=t50)
    #> method M +metaM(Mmethods("Hoenig"),K=K,Linf=Linf,Temp=Temp,tmax=tmax,t50=t50) +
    #> method M #> 1 HoenigNLS 1.6028619 #> 2 HoenigO 1.2741252 #> 3 HoenigOF 1.2562214 @@ -353,7 +372,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/mrClosed-1.png b/docs/reference/mrClosed-1.png index bc61aa89..75d10ba7 100644 Binary files a/docs/reference/mrClosed-1.png and b/docs/reference/mrClosed-1.png differ diff --git a/docs/reference/mrClosed-2.png b/docs/reference/mrClosed-2.png index 0b47c59e..d7de56b0 100644 Binary files a/docs/reference/mrClosed-2.png and b/docs/reference/mrClosed-2.png differ diff --git a/docs/reference/mrClosed.html b/docs/reference/mrClosed.html index 71b5bc29..2020e197 100644 --- a/docs/reference/mrClosed.html +++ b/docs/reference/mrClosed.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,73 +128,73 @@

    Estimate initial population size for single or multiple census mark-recaptur

    Estimates of the initial population size, along with associated confidence intervals, are constructed from single or multiple census mark-recapture data using a variety of methods. For single census data, the initial population size (N) is estimated from the number of marked animals from a first sample (M), number of captured animals in a second sample (n), and the number of recaptured marked animals in the second sample (m) using either the ‘naive’ Petersen method or Chapman, Ricker, or Bailey modifications of the Petersen method. Single census data can also be separated by group (e.g., size class) to estimate the initial population size by class and for the overall population size. For multiple census data, the initial population size is estimated from the number of captured animals (n), number of recaptured marked animals (m), the number of marked animals that are marked and returned to the population (R), or the number of extant marked animals prior to the sample (M) on each of several samples using either the Schnabel (1938) or Schumacher-Eschmeyer (1943) method.

    -
    mrClosed(
    -  M = NULL,
    -  n = NULL,
    -  m = NULL,
    -  R = NULL,
    -  method = c("Petersen", "Chapman", "Ricker", "Bailey", "Schnabel",
    -    "SchumacherEschmeyer"),
    -  labels = NULL,
    -  chapman.mod = TRUE
    -)
    +    
    mrClosed(
    +  M = NULL,
    +  n = NULL,
    +  m = NULL,
    +  R = NULL,
    +  method = c("Petersen", "Chapman", "Ricker", "Bailey", "Schnabel",
    +    "SchumacherEschmeyer"),
    +  labels = NULL,
    +  chapman.mod = TRUE
    +)
     
     # S3 method for mrClosed1
    -summary(
    -  object,
    -  digits = 0,
    -  incl.SE = FALSE,
    -  incl.all = TRUE,
    -  verbose = FALSE,
    -  ...
    -)
    +summary(
    +  object,
    +  digits = 0,
    +  incl.SE = FALSE,
    +  incl.all = TRUE,
    +  verbose = FALSE,
    +  ...
    +)
     
     # S3 method for mrClosed1
    -confint(
    -  object,
    -  parm = NULL,
    -  level = conf.level,
    -  conf.level = 0.95,
    -  digits = 0,
    -  type = c("suggested", "binomial", "hypergeometric", "normal", "Poisson"),
    -  bin.type = c("wilson", "exact", "asymptotic"),
    -  poi.type = c("exact", "daly", "byar", "asymptotic"),
    -  incl.all = TRUE,
    -  verbose = FALSE,
    -  ...
    -)
    +confint(
    +  object,
    +  parm = NULL,
    +  level = conf.level,
    +  conf.level = 0.95,
    +  digits = 0,
    +  type = c("suggested", "binomial", "hypergeometric", "normal", "Poisson"),
    +  bin.type = c("wilson", "exact", "asymptotic"),
    +  poi.type = c("exact", "daly", "byar", "asymptotic"),
    +  incl.all = TRUE,
    +  verbose = FALSE,
    +  ...
    +)
     
     # S3 method for mrClosed2
    -summary(object, digits = 0, verbose = FALSE, ...)
    +summary(object, digits = 0, verbose = FALSE, ...)
     
     # S3 method for mrClosed2
    -confint(
    -  object,
    -  parm = NULL,
    -  level = conf.level,
    -  conf.level = 0.95,
    -  digits = 0,
    -  type = c("suggested", "normal", "Poisson"),
    -  poi.type = c("exact", "daly", "byar", "asymptotic"),
    -  verbose = FALSE,
    -  ...
    -)
    +confint(
    +  object,
    +  parm = NULL,
    +  level = conf.level,
    +  conf.level = 0.95,
    +  digits = 0,
    +  type = c("suggested", "normal", "Poisson"),
    +  poi.type = c("exact", "daly", "byar", "asymptotic"),
    +  verbose = FALSE,
    +  ...
    +)
     
     # S3 method for mrClosed2
    -plot(
    -  x,
    -  pch = 19,
    -  col.pt = "black",
    -  xlab = "Marked in Population",
    -  ylab = "Prop. Recaptures in Sample",
    -  loess = FALSE,
    -  lty.loess = 2,
    -  lwd.loess = 1,
    -  col.loess = "gray20",
    -  trans.loess = 10,
    -  span = 0.9,
    -  ...
    -)
    +plot( + x, + pch = 19, + col.pt = "black", + xlab = "Marked in Population", + ylab = "Prop. Recaptures in Sample", + loess = FALSE, + lty.loess = 2, + lwd.loess = 1, + col.loess = "gray20", + trans.loess = 10, + span = 0.9, + ... +)

    Arguments

    @@ -371,7 +371,7 @@

    <

    9-Abundance from Capture-Recapture Data.

    References

    -

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

    +

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

    Krebs, C.J. 1989. Ecological Methodology. Addison-Welsey Educational Publishing.

    Ricker, W.E. 1975. Computation and interpretation of biological statistics of fish populations. Technical Report Bulletin 191, Bulletin of the Fisheries Research Board of Canada. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/1485.pdf.]

    Seber, G.A.F. 2002. The Estimation of Animal Abundance and Related Parameters. Edward Arnold, second edition.

    @@ -379,82 +379,104 @@

    R

    Schumacher, F.X. and R.W. Eschmeyer. 1943. The estimation of fish populations in lakes and ponds. Journal of the Tennessee Academy of Sciences, 18:228-249.

    See also

    -

    See capHistSum for generating input data from capture histories. See poiCI, binCI, and hyperCI for specifics on functions used in confidence interval construction. See mrOpen for handling mark-recapture data in an open population. See SunfishIN in FSAdata for an example to test matching of results with Ricker (1975)' See mrN.single and schnabel in fishmethods for similar functionality.

    +

    See capHistSum for generating input data from capture histories. See poiCI, binCI, and hyperCI for specifics on functions used in confidence interval construction. See mrOpen for handling mark-recapture data in an open population. See SunfishIN in FSAdata for an example to test matching of results with Ricker (1975)' See mrN.single and schnabel in fishmethods for similar functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ### Single census with no sub-groups ## Petersen estimate -- the default -mr1 <- mrClosed(346,184,49) -summary(mr1)
    #> N -#> [1,] 1299
    summary(mr1,verbose=TRUE)
    #> Used the 'naive' Petersen method with M=346, n=184, and m=49.
    #> N -#> [1,] 1299
    summary(mr1,incl.SE=TRUE)
    #> N SE -#> [1,] 1299 159
    summary(mr1,incl.SE=TRUE,digits=1)
    #> N SE -#> [1,] 1299.3 158.99
    confint(mr1)
    #> 95% LCI 95% UCI -#> [1,] 1034 1666
    confint(mr1,verbose=TRUE)
    #> The binomial (wilson method) distribution was used.
    #> 95% LCI 95% UCI -#> [1,] 1034 1666
    confint(mr1,type="hypergeometric")
    #> 95% LCI 95% UCI +mr1 <- mrClosed(346,184,49) +summary(mr1) +
    #> N +#> [1,] 1299
    summary(mr1,verbose=TRUE) +
    #> Used the 'naive' Petersen method with M=346, n=184, and m=49.
    #> N +#> [1,] 1299
    summary(mr1,incl.SE=TRUE) +
    #> N SE +#> [1,] 1299 159
    summary(mr1,incl.SE=TRUE,digits=1) +
    #> N SE +#> [1,] 1299.3 158.99
    confint(mr1) +
    #> 95% LCI 95% UCI +#> [1,] 1034 1666
    confint(mr1,verbose=TRUE) +
    #> The binomial (wilson method) distribution was used.
    #> 95% LCI 95% UCI +#> [1,] 1034 1666
    confint(mr1,type="hypergeometric") +
    #> 95% LCI 95% UCI #> [1,] 1049 1670
    ## Chapman modification of the Petersen estimate -mr2 <- mrClosed(346,184,49,method="Chapman") -summary(mr2,incl.SE=TRUE)
    #> N SE -#> [1,] 1283 142.1
    summary(mr2,incl.SE=TRUE,verbose=TRUE)
    #> Used Chapman's modification of the Petersen method with M=346, n=184, and m=49.
    #> N SE +mr2 <- mrClosed(346,184,49,method="Chapman") +summary(mr2,incl.SE=TRUE) +
    #> N SE +#> [1,] 1283 142.1
    summary(mr2,incl.SE=TRUE,verbose=TRUE) +
    #> Used Chapman's modification of the Petersen method with M=346, n=184, and m=49.
    #> N SE #> [1,] 1283 142.1
    ### Single census, using capHistSum() results ## data in capture history format -str(BluegillJL)
    #> 'data.frame': 277 obs. of 2 variables: +str(BluegillJL) +
    #> 'data.frame': 277 obs. of 2 variables: #> $ first : int 1 0 1 0 1 1 1 1 1 1 ... -#> $ second: int 0 1 0 1 0 0 0 0 0 0 ...
    ch1 <- capHistSum(BluegillJL) -mr3 <- mrClosed(ch1) -summary(mr3,verbose=TRUE)
    #> Used the 'naive' Petersen method with M=196, n=90, and m=9.
    #> N -#> [1,] 1960
    confint(mr3,verbose=TRUE)
    #> The Poisson (exact method) distribution was used.
    #> 95% LCI 95% UCI +#> $ second: int 0 1 0 1 0 0 0 0 0 0 ...
    ch1 <- capHistSum(BluegillJL) +mr3 <- mrClosed(ch1) +summary(mr3,verbose=TRUE) +
    #> Used the 'naive' Petersen method with M=196, n=90, and m=9.
    #> N +#> [1,] 1960
    confint(mr3,verbose=TRUE) +
    #> The Poisson (exact method) distribution was used.
    #> 95% LCI 95% UCI #> [1,] 1032 4286
    ### Single census with sub-groups -marked <- c(93,35,72,16,46,20) -captured <- c(103,30,73,17,39,18) -recaps <- c(20,23,52,15,35,16) -lbls <- c("YOY","Juvenile","Stock","Quality","Preferred","Memorable") -mr4 <- mrClosed(marked,captured,recaps,method="Ricker",labels=lbls) -summary(mr4)
    #> N +marked <- c(93,35,72,16,46,20) +captured <- c(103,30,73,17,39,18) +recaps <- c(20,23,52,15,35,16) +lbls <- c("YOY","Juvenile","Stock","Quality","Preferred","Memorable") +mr4 <- mrClosed(marked,captured,recaps,method="Ricker",labels=lbls) +summary(mr4) +
    #> N #> YOY 466 #> Juvenile 46 #> Stock 102 #> Quality 19 #> Preferred 52 #> Memorable 23 -#> All 708
    summary(mr4,incl.SE=TRUE)
    #> N SE +#> All 708
    summary(mr4,incl.SE=TRUE) +
    #> N SE #> YOY 466 88.7 #> Juvenile 46 4.4 #> Stock 102 7.4 #> Quality 19 1.5 #> Preferred 52 2.7 #> Memorable 23 1.8 -#> All 708 89.2
    summary(mr4,incl.SE=TRUE,verbose=TRUE)
    #> Used Ricker's modification of the Petersen method with observed inputs (by group) of:
    #> YOY: M=93, n=103, and m=20
    #> Juvenile: M=35, n=30, and m=23
    #> Stock: M=72, n=73, and m=52
    #> Quality: M=16, n=17, and m=15
    #> Preferred: M=46, n=39, and m=35
    #> Memorable: M=20, n=18, and m=16
    #> N SE +#> All 708 89.2
    summary(mr4,incl.SE=TRUE,verbose=TRUE) +
    #> Used Ricker's modification of the Petersen method with observed inputs (by group) of:
    #> YOY: M=93, n=103, and m=20
    #> Juvenile: M=35, n=30, and m=23
    #> Stock: M=72, n=73, and m=52
    #> Quality: M=16, n=17, and m=15
    #> Preferred: M=46, n=39, and m=35
    #> Memorable: M=20, n=18, and m=16
    #> N SE #> YOY 466 88.7 #> Juvenile 46 4.4 #> Stock 102 7.4 #> Quality 19 1.5 #> Preferred 52 2.7 #> Memorable 23 1.8 -#> All 708 89.2
    summary(mr4,incl.SE=TRUE,incl.all=FALSE,verbose=TRUE)
    #> Used Ricker's modification of the Petersen method with observed inputs (by group) of:
    #> YOY: M=93, n=103, and m=20
    #> Juvenile: M=35, n=30, and m=23
    #> Stock: M=72, n=73, and m=52
    #> Quality: M=16, n=17, and m=15
    #> Preferred: M=46, n=39, and m=35
    #> Memorable: M=20, n=18, and m=16
    #> N SE +#> All 708 89.2
    summary(mr4,incl.SE=TRUE,incl.all=FALSE,verbose=TRUE) +
    #> Used Ricker's modification of the Petersen method with observed inputs (by group) of:
    #> YOY: M=93, n=103, and m=20
    #> Juvenile: M=35, n=30, and m=23
    #> Stock: M=72, n=73, and m=52
    #> Quality: M=16, n=17, and m=15
    #> Preferred: M=46, n=39, and m=35
    #> Memorable: M=20, n=18, and m=16
    #> N SE #> YOY 466 88.7 #> Juvenile 46 4.4 #> Stock 102 7.4 #> Quality 19 1.5 #> Preferred 52 2.7 -#> Memorable 23 1.8
    confint(mr4)
    #> 95% LCI 95% UCI +#> Memorable 23 1.8
    confint(mr4) +
    #> 95% LCI 95% UCI #> YOY 325 691 #> Juvenile 41 60 #> Stock 91 121 #> Quality 18 25 #> Preferred 49 61 #> Memorable 22 31 -#> All 533 883
    confint(mr4,verbose=TRUE)
    #> YOY - The binomial (wilson method) distribution was used.
    #> Juvenile - The binomial (wilson method) distribution was used.
    #> Stock - The binomial (wilson method) distribution was used.
    #> Quality - The binomial (wilson method) distribution was used.
    #> Preferred - The binomial (wilson method) distribution was used.
    #> Memorable - The binomial (wilson method) distribution was used.
    #> All - The normal distribution was used.
    #> 95% LCI 95% UCI +#> All 533 883
    confint(mr4,verbose=TRUE) +
    #> YOY - The binomial (wilson method) distribution was used.
    #> Juvenile - The binomial (wilson method) distribution was used.
    #> Stock - The binomial (wilson method) distribution was used.
    #> Quality - The binomial (wilson method) distribution was used.
    #> Preferred - The binomial (wilson method) distribution was used.
    #> Memorable - The binomial (wilson method) distribution was used.
    #> All - The normal distribution was used.
    #> 95% LCI 95% UCI #> YOY 325 691 #> Juvenile 41 60 #> Stock 91 121 #> Quality 18 25 #> Preferred 49 61 #> Memorable 22 31 -#> All 533 883
    confint(mr4,incl.all=FALSE,verbose=TRUE)
    #> YOY - The binomial (wilson method) distribution was used.
    #> Juvenile - The binomial (wilson method) distribution was used.
    #> Stock - The binomial (wilson method) distribution was used.
    #> Quality - The binomial (wilson method) distribution was used.
    #> Preferred - The binomial (wilson method) distribution was used.
    #> Memorable - The binomial (wilson method) distribution was used.
    #> 95% LCI 95% UCI +#> All 533 883
    confint(mr4,incl.all=FALSE,verbose=TRUE) +
    #> YOY - The binomial (wilson method) distribution was used.
    #> Juvenile - The binomial (wilson method) distribution was used.
    #> Stock - The binomial (wilson method) distribution was used.
    #> Quality - The binomial (wilson method) distribution was used.
    #> Preferred - The binomial (wilson method) distribution was used.
    #> Memorable - The binomial (wilson method) distribution was used.
    #> 95% LCI 95% UCI #> YOY 325 691 #> Juvenile 41 60 #> Stock 91 121 @@ -463,25 +485,36 @@

    Examp #> Memorable 22 31

    ### Multiple Census ## Data in summarized form ... Schnabel method -mr5 <- with(PikeNY,mrClosed(n=n,m=m,R=R,method="Schnabel")) -plot(mr5)
    plot(mr5,loess=TRUE)
    summary(mr5)
    #> N -#> [1,] 87
    summary(mr5,verbose=TRUE)
    #> Used the Schnabel method with Chapman modification.
    #> N -#> [1,] 87
    confint(mr5)
    #> 95% LCI 95% UCI -#> [1,] 71 113
    confint(mr5,verbose=TRUE)
    #> The normal distribution was used.
    #> 95% LCI 95% UCI +mr5 <- with(PikeNY,mrClosed(n=n,m=m,R=R,method="Schnabel")) +plot(mr5) +
    plot(mr5,loess=TRUE) +
    summary(mr5) +
    #> N +#> [1,] 87
    summary(mr5,verbose=TRUE) +
    #> Used the Schnabel method with Chapman modification.
    #> N +#> [1,] 87
    confint(mr5) +
    #> 95% LCI 95% UCI +#> [1,] 71 113
    confint(mr5,verbose=TRUE) +
    #> The normal distribution was used.
    #> 95% LCI 95% UCI #> [1,] 71 113
    ## Schumacher-Eschmeyer method -mr6 <- with(PikeNY,mrClosed(n=n,m=m,R=R,method="Schumacher")) -summary(mr6)
    #> N -#> [1,] 85
    confint(mr6)
    #> 95% LCI 95% UCI +mr6 <- with(PikeNY,mrClosed(n=n,m=m,R=R,method="Schumacher")) +summary(mr6) +
    #> N +#> [1,] 85
    confint(mr6) +
    #> 95% LCI 95% UCI #> [1,] 76 96
    ### Capture history data summarized by capHistSum() # ignore first column of ID numbers -ch2 <- capHistSum(PikeNYPartial1,cols2ignore="id") +ch2 <- capHistSum(PikeNYPartial1,cols2ignore="id") ## Schnabel method -mr7 <- mrClosed(ch2,method="Schnabel") -plot(mr7)
    summary(mr7)
    #> N -#> [1,] 128
    confint(mr7)
    #> 95% LCI 95% UCI +mr7 <- mrClosed(ch2,method="Schnabel") +plot(mr7) +
    summary(mr7) +
    #> N +#> [1,] 128
    confint(mr7) +
    #> 95% LCI 95% UCI #> [1,] 75 238
    @@ -499,7 +532,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/mrOpen.html b/docs/reference/mrOpen.html index 1bbd631b..65fe4bb2 100644 --- a/docs/reference/mrOpen.html +++ b/docs/reference/mrOpen.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,28 +128,28 @@

    Jolly-Seber analysis from multiple mark-recapture events from an open popula

    This function takes the two parts of a Method B table and uses the Jolly-Seber method to estimate the population size at each possible sample period and the apparent survival rate and number of additional individuals added to the population between possible sample periods. This method assumes that the population is open.

    -
    jolly(...)
    +    
    jolly(...)
     
    -mrOpen(
    -  mb.top,
    -  mb.bot = NULL,
    -  type = c("Jolly", "Manly"),
    -  conf.level = 0.95,
    -  phi.full = TRUE
    -)
    +mrOpen(
    +  mb.top,
    +  mb.bot = NULL,
    +  type = c("Jolly", "Manly"),
    +  conf.level = 0.95,
    +  phi.full = TRUE
    +)
     
     # S3 method for mrOpen
    -summary(object, parm = c("N", "phi", "B", "M"), verbose = FALSE, ...)
    +summary(object, parm = c("N", "phi", "B", "M"), verbose = FALSE, ...)
     
     # S3 method for mrOpen
    -confint(
    -  object,
    -  parm = c("N", "phi", "B"),
    -  level = NULL,
    -  conf.level = NULL,
    -  verbose = FALSE,
    -  ...
    -)
    +confint( + object, + parm = c("N", "phi", "B"), + level = NULL, + conf.level = NULL, + verbose = FALSE, + ... +)

    Arguments

    @@ -225,7 +225,7 @@

    <

    9-Abundance from Capture-Recapture Data and 11-Mortality.

    References

    -

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

    +

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

    Jolly, G.M. 1965. Explicit estimates from capture-recapture data with both death and immigration -- stochastic model. Biometrika, 52:225-247.

    Krebs, C.J. 1989. Ecological Methodology. Harper & Row Publishers, New York.

    Leslie, P.H. and D. Chitty. 1951. The estimation of population parameters from data obtained by means of the capture-recapture method. I. The maximum likelihood equations for estimating the death-rate. Biometrika, 38:269-292.

    @@ -236,12 +236,16 @@

    R

    See also

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## First example -- capture histories summarized with capHistSum() -ch1 <- capHistSum(CutthroatAL,cols2use=-1) # ignore first column of fish ID -ex1 <- mrOpen(ch1) -summary(ex1)
    #> M M.se N N.se phi phi.se B B.se +ch1 <- capHistSum(CutthroatAL,cols2use=-1) # ignore first column of fish ID +ex1 <- mrOpen(ch1) +summary(ex1) +
    #> M M.se N N.se phi phi.se B B.se #> i=1 NA NA NA NA 0.411 0.088 NA NA #> i=2 36.6 6.4 561.1 117.9 0.349 0.045 198.6 48.2 #> i=3 127.8 13.4 394.2 44.2 0.370 0.071 526.3 119.7 @@ -250,7 +254,8 @@

    Examp #> i=6 117.6 7.3 436.1 30.3 0.451 0.069 357.2 61.2 #> i=7 175.1 24.6 553.7 84.3 0.268 0.072 106.9 36.2 #> i=8 100.2 24.7 255.3 65.4 NA NA NA NA -#> i=9 NA NA NA NA NA NA NA NA

    summary(ex1,verbose=TRUE)
    #> Observables: +#> i=9 NA NA NA NA NA NA NA NA
    summary(ex1,verbose=TRUE) +
    #> Observables: #> m n R r z #> i=1 0 89 89 26 NA #> i=2 22 352 352 96 4 @@ -271,7 +276,8 @@

    Examp #> i=6 117.6 7.3 436.1 30.3 0.451 0.069 357.2 61.2 #> i=7 175.1 24.6 553.7 84.3 0.268 0.072 106.9 36.2 #> i=8 100.2 24.7 255.3 65.4 NA NA NA NA -#> i=9 NA NA NA NA NA NA NA NA

    summary(ex1,parm="N")
    #> N N.se +#> i=9 NA NA NA NA NA NA NA NA
    summary(ex1,parm="N") +
    #> N N.se #> i=1 NA NA #> i=2 561.1 117.9 #> i=3 394.2 44.2 @@ -280,7 +286,8 @@

    Examp #> i=6 436.1 30.3 #> i=7 553.7 84.3 #> i=8 255.3 65.4 -#> i=9 NA NA

    summary(ex1,parm=c("N","phi"))
    #> N N.se phi phi.se +#> i=9 NA NA
    summary(ex1,parm=c("N","phi")) +
    #> N N.se phi phi.se #> i=1 NA NA 0.411 0.088 #> i=2 561.1 117.9 0.349 0.045 #> i=3 394.2 44.2 0.370 0.071 @@ -289,7 +296,8 @@

    Examp #> i=6 436.1 30.3 0.451 0.069 #> i=7 553.7 84.3 0.268 0.072 #> i=8 255.3 65.4 NA NA -#> i=9 NA NA NA NA

    confint(ex1)
    #> N.lci N.uci phi.lci phi.uci B.lci B.uci +#> i=9 NA NA NA NA
    confint(ex1) +
    #> N.lci N.uci phi.lci phi.uci B.lci B.uci #> i=1 NA NA 0.237 0.584 NA NA #> i=2 330.0 792.1 0.261 0.436 104.0 293.1 #> i=3 307.6 480.8 0.231 0.509 291.7 760.8 @@ -298,7 +306,8 @@

    Examp #> i=6 376.7 495.5 0.316 0.585 237.2 477.3 #> i=7 388.4 719.1 0.127 0.409 36.0 177.8 #> i=8 127.2 383.4 NA NA NA NA -#> i=9 NA NA NA NA NA NA

    confint(ex1,parm="N")
    #> N.lci N.uci +#> i=9 NA NA NA NA NA NA
    confint(ex1,parm="N") +
    #> N.lci N.uci #> i=1 NA NA #> i=2 330.0 792.1 #> i=3 307.6 480.8 @@ -307,7 +316,8 @@

    Examp #> i=6 376.7 495.5 #> i=7 388.4 719.1 #> i=8 127.2 383.4 -#> i=9 NA NA

    confint(ex1,parm=c("N","phi"))
    #> N.lci N.uci phi.lci phi.uci +#> i=9 NA NA
    confint(ex1,parm=c("N","phi")) +
    #> N.lci N.uci phi.lci phi.uci #> i=1 NA NA 0.237 0.584 #> i=2 330.0 792.1 0.261 0.436 #> i=3 307.6 480.8 0.231 0.509 @@ -316,7 +326,8 @@

    Examp #> i=6 376.7 495.5 0.316 0.585 #> i=7 388.4 719.1 0.127 0.409 #> i=8 127.2 383.4 NA NA -#> i=9 NA NA NA NA

    confint(ex1,verbose=TRUE)
    #> The Jolly method was used to construct confidence intervals.
    #> N.lci N.uci phi.lci phi.uci B.lci B.uci +#> i=9 NA NA NA NA
    confint(ex1,verbose=TRUE) +
    #> The Jolly method was used to construct confidence intervals.
    #> N.lci N.uci phi.lci phi.uci B.lci B.uci #> i=1 NA NA 0.237 0.584 NA NA #> i=2 330.0 792.1 0.261 0.436 104.0 293.1 #> i=3 307.6 480.8 0.231 0.509 291.7 760.8 @@ -327,29 +338,30 @@

    Examp #> i=8 127.2 383.4 NA NA NA NA #> i=9 NA NA NA NA NA NA

    ## Second example - Jolly's data -- summarized data entered "by hand" -s1 <- rep(NA,13) -s2 <- c(10,rep(NA,12)) -s3 <- c(3,34,rep(NA,11)) -s4 <- c(5,18,33,rep(NA,10)) -s5 <- c(2,8,13,30,rep(NA,9)) -s6 <- c(2,4,8,20,43,rep(NA,8)) -s7 <- c(1,6,5,10,34,56,rep(NA,7)) -s8 <- c(0,4,0,3,14,19,46,rep(NA,6)) -s9 <- c(0,2,4,2,11,12,28,51,rep(NA,5)) -s10 <- c(0,0,1,2,3,5,17,22,34,rep(NA,4)) -s11 <- c(1,2,3,1,0,4,8,12,16,30,rep(NA,3)) -s12 <- c(0,1,3,1,1,2,7,4,11,16,26,NA,NA) -s13 <- c(0,1,0,2,3,3,2,10,9,12,18,35,NA) -jolly.top <- cbind(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13) - -n <- c(54,146,169,209,220,209,250,176,172,127,123,120,142) -R <- c(54,143,164,202,214,207,243,175,169,126,120,120,0) -m <- c(0,10,37,56,53,77,112,86,110,84,77,72,95) -u <- n-m -jolly.bot <- rbind(m,u,n,R) - -ex2 <- mrOpen(jolly.top,jolly.bot) -summary(ex2,verbose=TRUE)
    #> Observables: +s1 <- rep(NA,13) +s2 <- c(10,rep(NA,12)) +s3 <- c(3,34,rep(NA,11)) +s4 <- c(5,18,33,rep(NA,10)) +s5 <- c(2,8,13,30,rep(NA,9)) +s6 <- c(2,4,8,20,43,rep(NA,8)) +s7 <- c(1,6,5,10,34,56,rep(NA,7)) +s8 <- c(0,4,0,3,14,19,46,rep(NA,6)) +s9 <- c(0,2,4,2,11,12,28,51,rep(NA,5)) +s10 <- c(0,0,1,2,3,5,17,22,34,rep(NA,4)) +s11 <- c(1,2,3,1,0,4,8,12,16,30,rep(NA,3)) +s12 <- c(0,1,3,1,1,2,7,4,11,16,26,NA,NA) +s13 <- c(0,1,0,2,3,3,2,10,9,12,18,35,NA) +jolly.top <- cbind(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13) + +n <- c(54,146,169,209,220,209,250,176,172,127,123,120,142) +R <- c(54,143,164,202,214,207,243,175,169,126,120,120,0) +m <- c(0,10,37,56,53,77,112,86,110,84,77,72,95) +u <- n-m +jolly.bot <- rbind(m,u,n,R) + +ex2 <- mrOpen(jolly.top,jolly.bot) +summary(ex2,verbose=TRUE) +
    #> Observables: #> m n R r z #> 1 0 54 54 24 NA #> 2 10 146 143 80 14 @@ -378,7 +390,8 @@

    Examp #> 10 314.3 27.6 473.3 48.8 0.880 0.121 82.8 39.1 #> 11 313.6 34.9 498.6 63.0 0.767 0.128 73.3 39.0 #> 12 273.7 36.2 453.6 66.6 NA NA NA NA -#> 13 NA NA NA NA NA NA NA NA

    confint(ex2,verbose=TRUE)
    #> The Jolly method was used to construct confidence intervals.
    #> N.lci N.uci phi.lci phi.uci B.lci B.uci +#> 13 NA NA NA NA NA NA NA NA
    confint(ex2,verbose=TRUE) +
    #> The Jolly method was used to construct confidence intervals.
    #> N.lci N.uci phi.lci phi.uci B.lci B.uci #> 1 NA NA 0.430 0.862 NA NA #> 2 205.0 727.5 0.793 1.226 -31.4 612.5 #> 3 512.0 1004.3 0.654 1.074 30.0 556.0 @@ -392,8 +405,9 @@

    Examp #> 11 375.1 622.0 0.516 1.019 -3.2 149.8 #> 12 323.1 584.1 NA NA NA NA #> 13 NA NA NA NA NA NA

    -ex3 <- mrOpen(jolly.top,jolly.bot,type="Manly") -summary(ex3,verbose=TRUE)
    #> Observables: +ex3 <- mrOpen(jolly.top,jolly.bot,type="Manly") +summary(ex3,verbose=TRUE) +
    #> Observables: #> m n R r z #> 1 0 54 54 24 NA #> 2 10 146 143 80 14 @@ -422,7 +436,8 @@

    Examp #> 10 314.3 473.3 0.880 82.8 #> 11 313.6 498.6 0.767 73.3 #> 12 273.7 453.6 NA NA -#> 13 NA NA NA NA

    confint(ex3,verbose=TRUE)
    #> Manly did not provide a method for constructing confidence intervals for B.
    #> The Manly method was used to construct confidence intervals.
    #> N.lci N.uci phi.lci phi.uci +#> 13 NA NA NA NA
    confint(ex3,verbose=TRUE) +
    #> Manly did not provide a method for constructing confidence intervals for B.
    #> The Manly method was used to construct confidence intervals.
    #> N.lci N.uci phi.lci phi.uci #> 1 NA NA 0.389 0.783 #> 2 301.3 979.4 0.705 1.100 #> 3 564.0 1210.0 0.627 1.028 @@ -437,7 +452,9 @@

    Examp #> 12 342.0 712.0 NA NA #> 13 NA NA NA NA

    ## demonstrate use of jolly() -ex3a <- jolly(jolly.top,jolly.bot)
    +ex3a<-jolly(jolly.top,jolly.bot) + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/nlsBoot.html b/docs/reference/nlsBoot.html index c0ccaae9..4b267e1c 100644 --- a/docs/reference/nlsBoot.html +++ b/docs/reference/nlsBoot.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -129,33 +129,33 @@

    Associated S3 methods for nlsBoot from nlstools.

    # S3 method for nlsBoot
    -confint(
    -  object,
    -  parm = NULL,
    -  level = conf.level,
    -  conf.level = 0.95,
    -  plot = FALSE,
    -  err.col = "black",
    -  err.lwd = 2,
    -  rows = NULL,
    -  cols = NULL,
    -  ...
    -)
    +confint(
    +  object,
    +  parm = NULL,
    +  level = conf.level,
    +  conf.level = 0.95,
    +  plot = FALSE,
    +  err.col = "black",
    +  err.lwd = 2,
    +  rows = NULL,
    +  cols = NULL,
    +  ...
    +)
     
     # S3 method for nlsBoot
    -predict(object, FUN, conf.level = 0.95, digits = NULL, ...)
    +predict(object, FUN, conf.level = 0.95, digits = NULL, ...)
     
    -htest(object, ...)
    +htest(object, ...)
     
     # S3 method for nlsBoot
    -htest(
    -  object,
    -  parm = NULL,
    -  bo = 0,
    -  alt = c("two.sided", "less", "greater"),
    -  plot = FALSE,
    -  ...
    -)
    +htest( + object, + parm =NULL, + bo =0, + alt =c("two.sided", "less", "greater"), + plot =FALSE, + ... +)

    Arguments

    @@ -231,28 +231,32 @@

    Details

    See also

    Boot and related methods in car and summary.nlsBoot in nlstools.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    fnx <- function(days,B1,B2,B3) { - if (length(B1) > 1) { - B2 <- B1[2] - B3 <- B1[3] - B1 <- B1[1] - } - B1/(1+exp(B2+B3*days)) -} -nl1 <- nls(cells~fnx(days,B1,B2,B3),data=Ecoli, - start=list(B1=6,B2=7.2,B3=-1.45)) -if (require(nlstools)) { - nl1.bootn <- nlstools::nlsBoot(nl1,niter=99) # too few to be useful - confint(nl1.bootn,"B1") - confint(nl1.bootn,c(2,3)) - confint(nl1.bootn,conf.level=0.90) - confint(nl1.bootn,plot=TRUE) - predict(nl1.bootn,fnx,days=3) - predict(nl1.bootn,fnx,days=1:3) - htest(nl1.bootn,1,bo=6,alt="less") -}
    #> Loading required package: nlstools
    #> +
    fnx <- function(days,B1,B2,B3) { + if (length(B1) > 1) { + B2 <- B1[2] + B3 <- B1[3] + B1 <- B1[1] + } + B1/(1+exp(B2+B3*days)) +} +nl1 <- nls(cells~fnx(days,B1,B2,B3),data=Ecoli, + start=list(B1=6,B2=7.2,B3=-1.45)) +if (require(nlstools)) { + nl1.bootn <- nlstools::nlsBoot(nl1,niter=99) # too few to be useful + confint(nl1.bootn,"B1") + confint(nl1.bootn,c(2,3)) + confint(nl1.bootn,conf.level=0.90) + confint(nl1.bootn,plot=TRUE) + predict(nl1.bootn,fnx,days=3) + predict(nl1.bootn,fnx,days=1:3) + htest(nl1.bootn,1,bo=6,alt="less") +} +
    #> Loading required package: nlstools
    #> #> 'nlstools' has been loaded.
    #> IMPORTANT NOTICE: Most nonlinear regression models and data set examples
    #> related to predictive microbiolgy have been moved to the package 'nlsMicrobio'
    #> Error in nlstools::nlsBoot(nl1, niter = 99): Procedure aborted: the fit only converged in 1 % during bootstrapping
    @@ -270,7 +274,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/nlsTracePlot-1.png b/docs/reference/nlsTracePlot-1.png index b8a873cb..e0b10903 100644 Binary files a/docs/reference/nlsTracePlot-1.png and b/docs/reference/nlsTracePlot-1.png differ diff --git a/docs/reference/nlsTracePlot-2.png b/docs/reference/nlsTracePlot-2.png index 217b7cd8..fd54da14 100644 Binary files a/docs/reference/nlsTracePlot-2.png and b/docs/reference/nlsTracePlot-2.png differ diff --git a/docs/reference/nlsTracePlot.html b/docs/reference/nlsTracePlot.html index 3aaafdfb..82d5194f 100644 --- a/docs/reference/nlsTracePlot.html +++ b/docs/reference/nlsTracePlot.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,20 +128,20 @@

    Adds model fits from nls iterations to active plot.

    Adds model fits from iterations of the nls algorithm as returned when trace=TRUE. Useful for diagnosing model fitting problems or issues associated with starting values.

    -
    nlsTracePlot(
    -  object,
    -  fun,
    -  from = NULL,
    -  to = NULL,
    -  n = 199,
    -  lwd = 2,
    -  pal = paletteChoices(),
    -  rev.col = FALSE,
    -  legend = "topright",
    -  cex.leg = 0.9,
    -  box.lty.leg = 0,
    -  add = TRUE
    -)
    +
    nlsTracePlot(
    +  object,
    +  fun,
    +  from = NULL,
    +  to = NULL,
    +  n = 199,
    +  lwd = 2,
    +  pal = paletteChoices(),
    +  rev.col = FALSE,
    +  legend = "topright",
    +  cex.leg = 0.9,
    +  box.lty.leg = 0,
    +  add = TRUE
    +)

    Arguments

    @@ -204,40 +204,50 @@

    Details

    Note

    The position of the “legend” can be controlled in three ways. First, if legend=TRUE, then the R console is suspended until the user places the legend on the plot by clicking on the point where the upper-left corner of the legend should appear. Second, legend= can be set to one of "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". In this case, the legend will be placed inside the plot frame at the given location. Finally, legend= can be set to a vector of length two which identifies the plot coordinates for the upper-left corner of where the legend should be placed. A legend will not be drawn if legend=FALSE or legend=NULL.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Examples following a successful fit -vb1 <- vbFuns() -fit1 <- nls(tl~vb1(age,Linf,K,t0),data=SpotVA1,start=list(Linf=12,K=0.3,t0=0)) -plot(tl~age,data=SpotVA1,pch=21,bg="gray40")
    nlsTracePlot(fit1,vb1,legend="bottomright")
    -r1 <- srFuns("Ricker") -fitSR1 <- nls(log(recruits)~log(r1(stock,a,b)),data=CodNorwegian,start=list(a=3,b=0.03)) -plot(recruits~stock,data=CodNorwegian,pch=21,bg="gray40",xlim=c(0,200))
    nlsTracePlot(fitSR1,r1)
    +vb1 <- vbFuns() +fit1 <- nls(tl~vb1(age,Linf,K,t0),data=SpotVA1,start=list(Linf=12,K=0.3,t0=0)) +plot(tl~age,data=SpotVA1,pch=21,bg="gray40") +
    nlsTracePlot(fit1,vb1,legend="bottomright") +
    +r1 <- srFuns("Ricker") +fitSR1 <- nls(log(recruits)~log(r1(stock,a,b)),data=CodNorwegian,start=list(a=3,b=0.03)) +plot(recruits~stock,data=CodNorwegian,pch=21,bg="gray40",xlim=c(0,200)) +
    nlsTracePlot(fitSR1,r1) +
    # no plot, but returns trace results as a matrix -( tmp <- nlsTracePlot(fitSR1,r1,add=FALSE) )
    #> [,1] [,2] [,3] -#> [1,] 87.357930 3.000000 0.03000000 -#> [2,] 8.192055 5.038795 0.01836117 -#> [3,] 7.572912 5.850261 0.01836117 -#> [4,] 7.569613 5.918852 0.01836117 -#> [5,] 7.569613 5.919256 0.01836117
    -if (FALSE) { -if (require(FSAdata)) { - data(BSkateGB,package="FSAdata") - wtr <- filterD(BSkateGB,season=="winter") - bh1 <- srFuns() - trc <- capture.output(try( - fitSR1 <- nls(recruits~bh1(spawners,a,b),wtr, - start=srStarts(recruits~spawners,data=wtr),trace=TRUE) - )) - plot(recruits~spawners,data=wtr,pch=21,bg="gray40") - nlsTracePlot(trc,bh1) +( tmp <- nlsTracePlot(fitSR1,r1,add=FALSE) ) +
    #> [,1] [,2] +#> [1,] 3.000000 0.03000000 +#> [2,] 5.038795 0.01836117 +#> [3,] 5.850261 0.01836117 +#> [4,] 5.918852 0.01836117 +#> [5,] 5.919256 0.01836117
    +if (FALSE) { +if (require(FSAdata)) { + data(BSkateGB,package="FSAdata") + wtr <- filterD(BSkateGB,season=="winter") + bh1 <- srFuns() + trc <- capture.output(try( + fitSR1 <- nls(recruits~bh1(spawners,a,b),wtr, + start=srStarts(recruits~spawners,data=wtr),trace=TRUE) + )) + plot(recruits~spawners,data=wtr,pch=21,bg="gray40") + nlsTracePlot(trc,bh1) # zoom in on y-axis - plot(recruits~spawners,data=wtr,pch=21,bg="gray40",ylim=c(0.02,0.05)) - nlsTracePlot(trc,bh1,legend="top") + plot(recruits~spawners,data=wtr,pch=21,bg="gray40",ylim=c(0.02,0.05)) + nlsTracePlot(trc,bh1,legend="top") # return just the trace results - ( tmp <- nlsTracePlot(trc,bh1,add=FALSE) ) -} -}
    + (tmp<-nlsTracePlot(trc,bh1,add=FALSE)) +} +} + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/oddeven.html b/docs/reference/oddeven.html index 7263c6d2..24dccf9f 100644 --- a/docs/reference/oddeven.html +++ b/docs/reference/oddeven.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,9 +128,9 @@

    Determine if a number is odd or even.

    Determine if a number is odd or even.

    -
    is.odd(x)
    +    
    is.odd(x)
     
    -is.even(x)
    +is.even(x)

    Arguments

    @@ -144,13 +144,21 @@

    Arg

    Value

    A logical vector of the same length as x.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Individual values -is.odd(1)
    #> [1] TRUE
    is.odd(2)
    #> [1] FALSE
    is.even(3)
    #> [1] FALSE
    is.even(4)
    #> [1] TRUE
    +is.odd(1) +
    #> [1] TRUE
    is.odd(2) +
    #> [1] FALSE
    is.even(3) +
    #> [1] FALSE
    is.even(4) +
    #> [1] TRUE
    ## Vector of values -d <- 1:8 -data.frame(d,odd=is.odd(d),even=is.even(d))
    #> d odd even +d <- 1:8 +data.frame(d,odd=is.odd(d),even=is.even(d)) +
    #> d odd even #> 1 1 TRUE FALSE #> 2 2 FALSE TRUE #> 3 3 TRUE FALSE @@ -174,7 +182,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/perc.html b/docs/reference/perc.html index 32fa9b8f..8989ea20 100644 --- a/docs/reference/perc.html +++ b/docs/reference/perc.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,13 +128,13 @@

    Computes the percentage of values in a vector less than or greater than (and

    Computes the percentage of values in a vector less than or greater than (and equal to) a user-supplied value.

    -
    perc(
    -  x,
    -  val,
    -  dir = c("geq", "gt", "leq", "lt"),
    -  na.rm = TRUE,
    -  digits = getOption("digits")
    -)
    +
    perc(
    +  x,
    +  val,
    +  dir = c("geq", "gt", "leq", "lt"),
    +  na.rm = TRUE,
    +  digits = getOption("digits")
    +)

    Arguments

    @@ -167,14 +167,26 @@

    Value

    Details

    This function is most useful when used with an apply-type of function.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## vector of values -( tmp <- c(1:8,NA,NA) )
    #> [1] 1 2 3 4 5 6 7 8 NA NA
    +( tmp <- c(1:8,NA,NA) ) +
    #> [1] 1 2 3 4 5 6 7 8 NA NA
    ## percentages excluding NA values -perc(tmp,5)
    #> [1] 50
    perc(tmp,5,"gt")
    #> [1] 37.5
    perc(tmp,5,"leq")
    #> [1] 62.5
    perc(tmp,5,"lt")
    #> [1] 50
    +perc(tmp,5) +
    #> [1] 50
    perc(tmp,5,"gt") +
    #> [1] 37.5
    perc(tmp,5,"leq") +
    #> [1] 62.5
    perc(tmp,5,"lt") +
    #> [1] 50
    ## percentages including NA values -perc(tmp,5,na.rm=FALSE)
    #> [1] 40
    perc(tmp,5,"gt",na.rm=FALSE)
    #> [1] 30
    perc(tmp,5,"leq",na.rm=FALSE)
    #> [1] 50
    perc(tmp,5,"lt",na.rm=FALSE)
    #> [1] 40
    +perc(tmp,5,na.rm=FALSE) +
    #> [1] 40
    perc(tmp,5,"gt",na.rm=FALSE) +
    #> [1] 30
    perc(tmp,5,"leq",na.rm=FALSE) +
    #> [1] 50
    perc(tmp,5,"lt",na.rm=FALSE) +
    #> [1] 40
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/plotAB-1.png b/docs/reference/plotAB-1.png index bd1a408b..3e8e25af 100644 Binary files a/docs/reference/plotAB-1.png and b/docs/reference/plotAB-1.png differ diff --git a/docs/reference/plotAB-2.png b/docs/reference/plotAB-2.png index 7508acf4..becd3b96 100644 Binary files a/docs/reference/plotAB-2.png and b/docs/reference/plotAB-2.png differ diff --git a/docs/reference/plotAB-3.png b/docs/reference/plotAB-3.png index 466e4abd..47b4aa85 100644 Binary files a/docs/reference/plotAB-3.png and b/docs/reference/plotAB-3.png differ diff --git a/docs/reference/plotAB-4.png b/docs/reference/plotAB-4.png index 00570868..41272083 100644 Binary files a/docs/reference/plotAB-4.png and b/docs/reference/plotAB-4.png differ diff --git a/docs/reference/plotAB.html b/docs/reference/plotAB.html index 712ae6e9..b086b8ee 100644 --- a/docs/reference/plotAB.html +++ b/docs/reference/plotAB.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,34 +128,34 @@

    Construct traditional (Campana-like) age-bias plots.

    Constructs a traditional (e.g., like that described in Campana et al. (1995)) age-bias plot to visualize potential differences in paired age estimates. Ages may be from, for example, two readers of the same structure, one reader at two times, two structures (e.g., scales, spines, otoliths), or one structure and known ages.

    -
    plotAB(
    -  x,
    -  what = c("bias", "Campana", "numbers"),
    -  xlab = x$ref.lab,
    -  ylab = x$nref.lab,
    -  xlim = NULL,
    -  ylim = NULL,
    -  yaxt = graphics::par("yaxt"),
    -  xaxt = graphics::par("xaxt"),
    -  col.agree = "gray60",
    -  lwd.agree = lwd,
    -  lty.agree = 2,
    -  lwd = 1,
    -  sfrac = 0,
    -  pch.mean = 19,
    -  pch.mean.sig = 21,
    -  cex.mean = lwd,
    -  col.CI = "black",
    -  col.CIsig = "red",
    -  lwd.CI = lwd,
    -  sfrac.CI = sfrac,
    -  show.n = FALSE,
    -  nYpos = 1.03,
    -  cex.n = 0.75,
    -  cex.numbers = 0.75,
    -  col.numbers = "black",
    -  ...
    -)
    +
    plotAB(
    +  x,
    +  what = c("bias", "Campana", "numbers"),
    +  xlab = x$ref.lab,
    +  ylab = x$nref.lab,
    +  xlim = NULL,
    +  ylim = NULL,
    +  yaxt = graphics::par("yaxt"),
    +  xaxt = graphics::par("xaxt"),
    +  col.agree = "gray60",
    +  lwd.agree = lwd,
    +  lty.agree = 2,
    +  lwd = 1,
    +  sfrac = 0,
    +  pch.mean = 19,
    +  pch.mean.sig = 21,
    +  cex.mean = lwd,
    +  col.CI = "black",
    +  col.CIsig = "red",
    +  lwd.CI = lwd,
    +  sfrac.CI = sfrac,
    +  show.n = FALSE,
    +  nYpos = 1.03,
    +  cex.n = 0.75,
    +  cex.numbers = 0.75,
    +  col.numbers = "black",
    +  ...
    +)

    Arguments

    @@ -270,20 +270,27 @@

    R

    See also

    See ageBias and its plot method for what I consider a better age-bias plot; agePrecision for measures of precision between pairs of age estimates; and compare2 in fishmethods for similar functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    # Must create ageBias object first -ab1 <- ageBias(scaleC~otolithC,data=WhitefishLC, - ref.lab="Otolith Age",nref.lab="Scale Age") - +ab1 <- ageBias(scaleC~otolithC,data=WhitefishLC, + ref.lab="Otolith Age",nref.lab="Scale Age") + # Default plot -plotAB(ab1)
    +plotAB(ab1) +
    # Very close to Campana et al. (2001) -plotAB(ab1,pch.mean.sig=19,col.CIsig="black",sfrac=0.01, - ylim=c(-1,23),xlim=c(-1,23))
    # Show sample sizes (different position and size than default) -plotAB(ab1,show.n=TRUE,nYpos=0.02,cex.n=0.5)
    +plotAB(ab1,pch.mean.sig=19,col.CIsig="black",sfrac=0.01, + ylim=c(-1,23),xlim=c(-1,23)) +
    # Show sample sizes (different position and size than default) +plotAB(ab1,show.n=TRUE,nYpos=0.02,cex.n=0.5) +
    # Traditional numbers plot -plotAB(ab1,what="numbers")
    +plotAB(ab1,what="numbers") +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/plotBinResp-1.png b/docs/reference/plotBinResp-1.png index 85414173..6f91286a 100644 Binary files a/docs/reference/plotBinResp-1.png and b/docs/reference/plotBinResp-1.png differ diff --git a/docs/reference/plotBinResp-10.png b/docs/reference/plotBinResp-10.png index 20c3477d..0ebf3f28 100644 Binary files a/docs/reference/plotBinResp-10.png and b/docs/reference/plotBinResp-10.png differ diff --git a/docs/reference/plotBinResp-2.png b/docs/reference/plotBinResp-2.png index b250b18b..a7323041 100644 Binary files a/docs/reference/plotBinResp-2.png and b/docs/reference/plotBinResp-2.png differ diff --git a/docs/reference/plotBinResp-3.png b/docs/reference/plotBinResp-3.png index cc573b2c..77a9cbe1 100644 Binary files a/docs/reference/plotBinResp-3.png and b/docs/reference/plotBinResp-3.png differ diff --git a/docs/reference/plotBinResp-4.png b/docs/reference/plotBinResp-4.png index 1f3dd32e..48b2596d 100644 Binary files a/docs/reference/plotBinResp-4.png and b/docs/reference/plotBinResp-4.png differ diff --git a/docs/reference/plotBinResp-5.png b/docs/reference/plotBinResp-5.png index f8ce3612..2e3d1889 100644 Binary files a/docs/reference/plotBinResp-5.png and b/docs/reference/plotBinResp-5.png differ diff --git a/docs/reference/plotBinResp-6.png b/docs/reference/plotBinResp-6.png index 2db123e8..0431da3d 100644 Binary files a/docs/reference/plotBinResp-6.png and b/docs/reference/plotBinResp-6.png differ diff --git a/docs/reference/plotBinResp-7.png b/docs/reference/plotBinResp-7.png index 32fb3c3c..e708b1f3 100644 Binary files a/docs/reference/plotBinResp-7.png and b/docs/reference/plotBinResp-7.png differ diff --git a/docs/reference/plotBinResp-8.png b/docs/reference/plotBinResp-8.png index d385aa64..f908c1c3 100644 Binary files a/docs/reference/plotBinResp-8.png and b/docs/reference/plotBinResp-8.png differ diff --git a/docs/reference/plotBinResp-9.png b/docs/reference/plotBinResp-9.png index 02ab4aaf..4e2089ae 100644 Binary files a/docs/reference/plotBinResp-9.png and b/docs/reference/plotBinResp-9.png differ diff --git a/docs/reference/plotBinResp.html b/docs/reference/plotBinResp.html index dde16f0c..cb78ebec 100644 --- a/docs/reference/plotBinResp.html +++ b/docs/reference/plotBinResp.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,30 +128,30 @@

    Plots a binary response variable versus a quantitative explanatory variable.

    A function to plot a binary response variable versus a quantitative explanatory variable.

    -
    plotBinResp(x, ...)
    +    
    plotBinResp(x, ...)
     
     # S3 method for default
    -plotBinResp(
    -  x,
    -  y,
    -  xlab = paste(deparse(substitute(x))),
    -  ylab = paste(deparse(substitute(y))),
    -  plot.pts = TRUE,
    -  col.pt = "black",
    -  transparency = NULL,
    -  plot.p = TRUE,
    -  breaks = 25,
    -  p.col = "blue",
    -  p.pch = 3,
    -  p.cex = 1.25,
    -  yaxis1.ticks = seq(0, 1, 0.1),
    -  yaxis1.lbls = c(0, 0.5, 1),
    -  yaxis2.show = TRUE,
    -  ...
    -)
    +plotBinResp(
    +  x,
    +  y,
    +  xlab = paste(deparse(substitute(x))),
    +  ylab = paste(deparse(substitute(y))),
    +  plot.pts = TRUE,
    +  col.pt = "black",
    +  transparency = NULL,
    +  plot.p = TRUE,
    +  breaks = 25,
    +  p.col = "blue",
    +  p.pch = 3,
    +  p.cex = 1.25,
    +  yaxis1.ticks = seq(0, 1, 0.1),
    +  yaxis1.lbls = c(0, 0.5, 1),
    +  yaxis2.show = TRUE,
    +  ...
    +)
     
     # S3 method for formula
    -plotBinResp(x, data = NULL, xlab = names(mf)[2], ylab = names(mf)[1], ...)
    +plotBinResp(x, data = NULL, xlab = names(mf)[2], ylab = names(mf)[1], ...)

    Arguments

    @@ -238,32 +238,45 @@

    Note

    See also

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## NASA space shuttle o-ring failures -- from graphics package -fail <- factor(c(2,2,2,2,1,1,1,1,1,1,2,1,2,1,1,1,1,2,1,1,1,1,1), -levels = 1:2, labels = c("no","yes")) -temperature <- c(53,57,58,63,66,67,67,67,68,69,70,70,70,70,72,73,75,75,76,76,78,79,81) -d <- data.frame(temperature,fail,fail2=factor(fail,levels=c("yes","no"))) +fail <- factor(c(2,2,2,2,1,1,1,1,1,1,2,1,2,1,1,1,1,2,1,1,1,1,1), +levels = 1:2, labels = c("no","yes")) +temperature <- c(53,57,58,63,66,67,67,67,68,69,70,70,70,70,72,73,75,75,76,76,78,79,81) +d <- data.frame(temperature,fail,fail2=factor(fail,levels=c("yes","no"))) ## Default plot (using formula notation) -plotBinResp(fail~temperature,data=d)
    plotBinResp(fail2~temperature,data=d)
    +plotBinResp(fail~temperature,data=d) +
    plotBinResp(fail2~temperature,data=d) +
    ## Controlling where proportions are computed with a sequence in breaks -plotBinResp(fail~temperature,data=d,breaks=seq(50,85,5))
    +plotBinResp(fail~temperature,data=d,breaks=seq(50,85,5)) +
    ## Controlling where proportions are computed with an integer in breaks -plotBinResp(fail~temperature,data=d,breaks=10)
    +plotBinResp(fail~temperature,data=d,breaks=10) +
    ## Controlling where proportions are computed at each value of x -plotBinResp(fail~temperature,data=d,breaks=NULL)
    +plotBinResp(fail~temperature,data=d,breaks=NULL) +
    ## Don't plot points, just plot proportions -plotBinResp(fail~temperature,data=d,plot.pts=FALSE)
    +plotBinResp(fail~temperature,data=d,plot.pts=FALSE) +
    ## Don't plot proportions, just plot points -plotBinResp(fail~temperature,data=d,plot.p=FALSE)
    +plotBinResp(fail~temperature,data=d,plot.p=FALSE) +
    ## Change points colors, and eliminate transparency -plotBinResp(fail~temperature,data=d,col.pt="red",transparency=1)
    +plotBinResp(fail~temperature,data=d,col.pt="red",transparency=1) +
    ## Remove the right y-axis -plotBinResp(fail~temperature,data=d,yaxis2.show=FALSE)
    +plotBinResp(fail~temperature,data=d,yaxis2.show=FALSE) +
    ## Change left y-axis ticks -plotBinResp(fail~temperature,data=d,yaxis1.ticks=c(0,1),yaxis1.lbls=c(0,1))
    +plotBinResp(fail~temperature,data=d,yaxis1.ticks=c(0,1),yaxis1.lbls=c(0,1)) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/poiCI.html b/docs/reference/poiCI.html index f7075314..22e686d6 100644 --- a/docs/reference/poiCI.html +++ b/docs/reference/poiCI.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,12 +128,12 @@

    Confidence interval for Poisson counts.

    Computes a confidence interval for the Poisson counts.

    -
    poiCI(
    -  x,
    -  conf.level = 0.95,
    -  type = c("exact", "daly", "byar", "asymptotic"),
    -  verbose = FALSE
    -)
    +
    poiCI(
    +  x,
    +  conf.level = 0.95,
    +  type = c("exact", "daly", "byar", "asymptotic"),
    +  verbose = FALSE
    +)

    Arguments

    @@ -163,28 +163,40 @@

    Details

    Computes a CI for the Poisson counts using the exact, gamma distribution (daly`), Byar's (byar), or normal approximation (asymptotic) methods.

    The pois.daly function gives essentially identical answers to the pois.exact function except when x=0. When x=0, for the upper confidence limit pois.exact returns 3.689 and pois.daly returns 2.996.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com, though this is largely based on pois.exact, pois.daly, pois.byar, and pois.approx from the old epitools package.

    Examples

    ## Demonstrates using all types at once -poiCI(12)
    #> 95% LCI 95% UCI +poiCI(12) +
    #> 95% LCI 95% UCI #> Exact 6.200603 20.96156 #> Daly 6.200575 20.96159 #> Byar 6.552977 20.32447 #> Asymptotic 5.210486 18.78951
    ## Selecting types -poiCI(12,type="daly")
    #> 95% LCI 95% UCI -#> 6.200575 20.96159
    poiCI(12,type="byar")
    #> 95% LCI 95% UCI -#> 6.552977 20.32447
    poiCI(12,type="asymptotic")
    #> 95% LCI 95% UCI -#> 5.210486 18.78951
    poiCI(12,type="asymptotic",verbose=TRUE)
    #> x 95% LCI 95% UCI -#> Asymptotic 12 5.210486 18.78951
    poiCI(12,type=c("exact","daly"))
    #> 95% LCI 95% UCI +poiCI(12,type="daly") +
    #> 95% LCI 95% UCI +#> 6.200575 20.96159
    poiCI(12,type="byar") +
    #> 95% LCI 95% UCI +#> 6.552977 20.32447
    poiCI(12,type="asymptotic") +
    #> 95% LCI 95% UCI +#> 5.210486 18.78951
    poiCI(12,type="asymptotic",verbose=TRUE) +
    #> x 95% LCI 95% UCI +#> Asymptotic 12 5.210486 18.78951
    poiCI(12,type=c("exact","daly")) +
    #> 95% LCI 95% UCI #> Exact 6.200603 20.96156 -#> Daly 6.200575 20.96159
    poiCI(12,type=c("exact","daly"),verbose=TRUE)
    #> x 95% LCI 95% UCI +#> Daly 6.200575 20.96159
    poiCI(12,type=c("exact","daly"),verbose=TRUE) +
    #> x 95% LCI 95% UCI #> Exact 12 6.200603 20.96156 #> Daly 12 6.200575 20.96159
    ## Demonstrates use with multiple inputs -poiCI(c(7,10),type="exact")
    #> 95% LCI 95% UCI +poiCI(c(7,10),type="exact") +
    #> 95% LCI 95% UCI #> 2.814358 14.42268 -#> 4.795389 18.39036
    poiCI(c(7,10),type="exact",verbose=TRUE)
    #> x 95% LCI 95% UCI +#> 4.795389 18.39036
    poiCI(c(7,10),type="exact",verbose=TRUE) +
    #> x 95% LCI 95% UCI #> [1,] 7 2.814358 14.42268 #> [2,] 10 4.795389 18.39036
    @@ -203,7 +215,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/psdAdd.html b/docs/reference/psdAdd.html index 4fe97ab5..285d3478 100644 --- a/docs/reference/psdAdd.html +++ b/docs/reference/psdAdd.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,31 +128,31 @@

    Creates a vector of Gabelhouse lengths for each species in an entire data fr

    Creates a vector of the Gabelhouse lengths specific to a species for all individuals in an entire data frame.

    -
    psdAdd(len, ...)
    +    
    psdAdd(len, ...)
     
     # S3 method for default
    -psdAdd(
    -  len,
    -  species,
    -  units = c("mm", "cm", "in"),
    -  use.names = TRUE,
    -  addSpec = NULL,
    -  addLens = NULL,
    -  verbose = TRUE,
    -  ...
    -)
    +psdAdd(
    +  len,
    +  species,
    +  units = c("mm", "cm", "in"),
    +  use.names = TRUE,
    +  addSpec = NULL,
    +  addLens = NULL,
    +  verbose = TRUE,
    +  ...
    +)
     
     # S3 method for formula
    -psdAdd(
    -  len,
    -  data = NULL,
    -  units = c("mm", "cm", "in"),
    -  use.names = TRUE,
    -  addSpec = NULL,
    -  addLens = NULL,
    -  verbose = TRUE,
    -  ...
    -)
    +psdAdd( + len, + data = NULL, + units = c("mm", "cm", "in"), + use.names = TRUE, + addSpec = NULL, + addLens = NULL, + verbose = TRUE, + ... +)

    Arguments

    @@ -208,62 +208,76 @@

    <

    6-Size Structure.

    References

    -

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

    +

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

    Guy, C.S., R.M. Neumann, and D.W. Willis. 2006. New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS). Fisheries 31:86-87. [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.]

    Guy, C.S., R.M. Neumann, D.W. Willis, and R.O. Anderson. 2006. Proportional size distribution (PSD): A further refinement of population size structure index terminology. Fisheries 32:348. [Was (is?) from http://pubstorage.sdstate.edu/wfs/450-F.pdf.]

    Willis, D.W., B.R. Murphy, and C.S. Guy. 1993. Stock density indices: development, use, and limitations. Reviews in Fisheries Science 1:203-222. [Was (is?) from http://web1.cnre.vt.edu/murphybr/web/Readings/Willis%20et%20al.pdf.]

    See also

    psdVal, psdCalc, psdPlot, PSDlit, and wrAdd for related functions. See mapvalues for help in changing species names to match those in PSDlit.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Create random data for three species # only for repeatability -set.seed(345234534) -dbg <- data.frame(species=factor(rep(c("Bluegill"),30)),tl=round(rnorm(30,130,50),0)) -dbg$wt <- round(4.23e-06*dbg$tl^3.316+rnorm(30,0,10),1) -dlb <- data.frame(species=factor(rep(c("Largemouth Bass"),30)),tl=round(rnorm(30,350,60),0)) -dlb$wt <- round(2.96e-06*dlb$tl^3.273+rnorm(30,0,60),1) -dbt <- data.frame(species=factor(rep(c("Bluefin Tuna"),30)),tl=round(rnorm(30,1900,300),0)) -dbt$wt <- round(4.5e-05*dbt$tl^2.8+rnorm(30,0,6000),1) -df <- rbind(dbg,dlb,dbt) -str(df)
    #> 'data.frame': 90 obs. of 3 variables: +set.seed(345234534) +dbg <- data.frame(species=factor(rep(c("Bluegill"),30)),tl=round(rnorm(30,130,50),0)) +dbg$wt <- round(4.23e-06*dbg$tl^3.316+rnorm(30,0,10),1) +dlb <- data.frame(species=factor(rep(c("Largemouth Bass"),30)),tl=round(rnorm(30,350,60),0)) +dlb$wt <- round(2.96e-06*dlb$tl^3.273+rnorm(30,0,60),1) +dbt <- data.frame(species=factor(rep(c("Bluefin Tuna"),30)),tl=round(rnorm(30,1900,300),0)) +dbt$wt <- round(4.5e-05*dbt$tl^2.8+rnorm(30,0,6000),1) +df <- rbind(dbg,dlb,dbt) +str(df) +
    #> 'data.frame': 90 obs. of 3 variables: #> $ species: Factor w/ 3 levels "Bluegill","Largemouth Bass",..: 1 1 1 1 1 1 1 1 1 1 ... #> $ tl : num 42 73 152 184 167 94 138 169 86 157 ... #> $ wt : num -12.5 4.8 86.6 134.4 91.9 ...
    ## Examples (non-dplyr) # Add variable using category names -- formula notation -df$PSD <- psdAdd(tl~species,data=df)
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    head(df)
    #> species tl wt PSD +df$PSD <- psdAdd(tl~species,data=df) +
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    head(df) +
    #> species tl wt PSD #> 1 Bluegill 42 -12.5 substock #> 2 Bluegill 73 4.8 substock #> 3 Bluegill 152 86.6 quality #> 4 Bluegill 184 134.4 quality #> 5 Bluegill 167 91.9 quality #> 6 Bluegill 94 38.3 stock
    # Add variable using category names -- non-formula notation -df$PSD1 <- psdAdd(df$tl,df$species)
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    head(df)
    #> species tl wt PSD PSD1 +df$PSD1 <- psdAdd(df$tl,df$species) +
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    head(df) +
    #> species tl wt PSD PSD1 #> 1 Bluegill 42 -12.5 substock substock #> 2 Bluegill 73 4.8 substock substock #> 3 Bluegill 152 86.6 quality quality #> 4 Bluegill 184 134.4 quality quality #> 5 Bluegill 167 91.9 quality quality #> 6 Bluegill 94 38.3 stock stock
    # Add variable using length values as names -df$PSD2 <- psdAdd(tl~species,data=df,use.names=FALSE)
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    head(df)
    #> species tl wt PSD PSD1 PSD2 +df$PSD2 <- psdAdd(tl~species,data=df,use.names=FALSE) +
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    head(df) +
    #> species tl wt PSD PSD1 PSD2 #> 1 Bluegill 42 -12.5 substock substock 0 #> 2 Bluegill 73 4.8 substock substock 0 #> 3 Bluegill 152 86.6 quality quality 150 #> 4 Bluegill 184 134.4 quality quality 150 #> 5 Bluegill 167 91.9 quality quality 150 #> 6 Bluegill 94 38.3 stock stock 80
    # Add additional length and name for Bluegill -df$PSD3 <- psdAdd(tl~species,data=df,addSpec="Bluegill",addLens=175)
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    head(df)
    #> species tl wt PSD PSD1 PSD2 PSD3 +df$PSD3 <- psdAdd(tl~species,data=df,addSpec="Bluegill",addLens=175) +
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    head(df) +
    #> species tl wt PSD PSD1 PSD2 PSD3 #> 1 Bluegill 42 -12.5 substock substock 0 0 #> 2 Bluegill 73 4.8 substock substock 0 0 #> 3 Bluegill 152 86.6 quality quality 150 150 #> 4 Bluegill 184 134.4 quality quality 150 175 #> 5 Bluegill 167 91.9 quality quality 150 150 #> 6 Bluegill 94 38.3 stock stock 80 80
    # Add additional lengths and names for Bluegill and Largemouth Bass from a data.frame -addls <- data.frame(species=c("Bluegill","Largemouth Bass","Largemouth Bass"), - lens=c(175,254,356)) -df$psd4 <- psdAdd(tl~species,data=df,addSpec=addls$species,addLens=addls$lens)
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    head(df)
    #> species tl wt PSD PSD1 PSD2 PSD3 psd4 +addls <- data.frame(species=c("Bluegill","Largemouth Bass","Largemouth Bass"), + lens=c(175,254,356)) +df$psd4 <- psdAdd(tl~species,data=df,addSpec=addls$species,addLens=addls$lens) +
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    head(df) +
    #> species tl wt PSD PSD1 PSD2 PSD3 psd4 #> 1 Bluegill 42 -12.5 substock substock 0 0 0 #> 2 Bluegill 73 4.8 substock substock 0 0 0 #> 3 Bluegill 152 86.6 quality quality 150 150 150 @@ -271,13 +285,15 @@

    Examp #> 5 Bluegill 167 91.9 quality quality 150 150 150 #> 6 Bluegill 94 38.3 stock stock 80 80 80

    ## All of the above but using dplyr -if (require(dplyr)) { - df <- df %>% - mutate(PSD1A=psdAdd(tl,species)) %>% - mutate(PSD2A=psdAdd(tl,species,use.names=FALSE)) %>% - mutate(psd3a=psdAdd(tl,species,addSpec="Bluegill",addLens=175)) %>% - mutate(psd4a=psdAdd(tl,species,addSpec=addls$species,addLens=addls$lens)) -}
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    df
    #> species tl wt PSD PSD1 PSD2 PSD3 psd4 PSD1A +if (require(dplyr)) { + df <- df %>% + mutate(PSD1A=psdAdd(tl,species)) %>% + mutate(PSD2A=psdAdd(tl,species,use.names=FALSE)) %>% + mutate(psd3a=psdAdd(tl,species,addSpec="Bluegill",addLens=175)) %>% + mutate(psd4a=psdAdd(tl,species,addSpec=addls$species,addLens=addls$lens)) +} +
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    #> No known Gabelhouse (PSD) lengths for Bluefin Tuna
    df +
    #> species tl wt PSD PSD1 PSD2 PSD3 psd4 PSD1A #> 1 Bluegill 42 -12.5 substock substock 0 0 0 substock #> 2 Bluegill 73 4.8 substock substock 0 0 0 substock #> 3 Bluegill 152 86.6 quality quality 150 150 150 quality @@ -475,7 +491,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/psdCI.html b/docs/reference/psdCI.html index 687d5d76..9b4f038d 100644 --- a/docs/reference/psdCI.html +++ b/docs/reference/psdCI.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,16 +128,16 @@

    Compute confidence intervals for PSD-X and PSD X-Y values.

    Compute confidence intervals for (traditional) PSD-X and (incremental) PSD X-Y values as requested by the user.

    -
    psdCI(
    -  indvec,
    -  ptbl,
    -  n,
    -  method = c("binomial", "multinomial"),
    -  bin.type = c("wilson", "exact", "asymptotic"),
    -  conf.level = 0.95,
    -  label = NULL,
    -  digits = 1
    -)
    +
    psdCI(
    +  indvec,
    +  ptbl,
    +  n,
    +  method = c("binomial", "multinomial"),
    +  bin.type = c("wilson", "exact", "asymptotic"),
    +  conf.level = 0.95,
    +  label = NULL,
    +  digits = 1
    +)

    Arguments

    @@ -192,44 +192,53 @@

    <

    6-Size Structure.

    References

    -

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

    +

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

    Brenden, T.O., T. Wagner, and B.R. Murphy. 2008. Novel tools for analyzing proportional size distribution index data. North American Journal of Fisheries Management 28:1233-1242. [Was (is?) from http://qfc.fw.msu.edu/Publications/Publication%20List/2008/Novel%20Tools%20for%20Analyzing%20Proportional%20Size%20Distribution_Brenden.pdf.]

    See also

    See psdVal, psdPlot, psdAdd, PSDlit, tictactoe, lencat, and rcumsum for related functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## similar to Brenden et al. (2008) -n <- 997 -ipsd <- c(130,491,253,123)/n +n <- 997 +ipsd <- c(130,491,253,123)/n ## single binomial -psdCI(c(0,0,1,1),ipsd,n=n)
    #> Estimate 95% LCI 95% UCI -#> [1,] 37.7 34.8 40.8
    psdCI(c(1,0,0,0),ipsd,n=n,label="PSD S-Q")
    #> Estimate 95% LCI 95% UCI +psdCI(c(0,0,1,1),ipsd,n=n) +
    #> Estimate 95% LCI 95% UCI +#> [1,] 37.7 34.8 40.8
    psdCI(c(1,0,0,0),ipsd,n=n,label="PSD S-Q") +
    #> Estimate 95% LCI 95% UCI #> PSD S-Q 13 11.1 15.3
    ## single multinomial -psdCI(c(0,0,1,1),ipsd,n=n,method="multinomial")
    #> Estimate 95% LCI 95% UCI -#> [1,] 37.7 33.4 42
    psdCI(c(1,0,0,0),ipsd,n=n,method="multinomial",label="PSD S-Q")
    #> Estimate 95% LCI 95% UCI +psdCI(c(0,0,1,1),ipsd,n=n,method="multinomial") +
    #> Estimate 95% LCI 95% UCI +#> [1,] 37.7 33.4 42
    psdCI(c(1,0,0,0),ipsd,n=n,method="multinomial",label="PSD S-Q") +
    #> Estimate 95% LCI 95% UCI #> PSD S-Q 13 10.1 16
    ## multiple multinomials (but see psdCalc()) -lbls <- c("PSD S-Q","PSD Q-P","PSD P-M","PSD M-T","PSD","PSD-P") -imat <- matrix(c(1,0,0,0, +lbls <- c("PSD S-Q","PSD Q-P","PSD P-M","PSD M-T","PSD","PSD-P") +imat <- matrix(c(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, 0,1,1,1, - 0,0,1,1),nrow=6,byrow=TRUE) -rownames(imat) <- lbls -imat
    #> [,1] [,2] [,3] [,4] + 0,0,1,1),nrow=6,byrow=TRUE) +rownames(imat) <- lbls +imat +
    #> [,1] [,2] [,3] [,4] #> PSD S-Q 1 0 0 0 #> PSD Q-P 0 1 0 0 #> PSD P-M 0 0 1 0 #> PSD M-T 0 0 0 1 #> PSD 0 1 1 1 #> PSD-P 0 0 1 1
    -mcis <- t(apply(imat,MARGIN=1,FUN=psdCI,ptbl=ipsd,n=n,method="multinomial")) -colnames(mcis) <- c("Estimate","95% LCI","95% UCI") -mcis
    #> Estimate 95% LCI 95% UCI +mcis <- t(apply(imat,MARGIN=1,FUN=psdCI,ptbl=ipsd,n=n,method="multinomial")) +colnames(mcis) <- c("Estimate","95% LCI","95% UCI") +mcis +
    #> Estimate 95% LCI 95% UCI #> PSD S-Q 13.0 10.1 16.0 #> PSD Q-P 49.2 44.8 53.7 #> PSD P-M 25.4 21.5 29.2 @@ -237,9 +246,10 @@

    Examp #> PSD 87.0 84.0 89.9 #> PSD-P 37.7 33.4 42.0

    ## Multiple "Bonferroni-corrected" (for six comparisons) binomial method -bcis <- t(apply(imat,MARGIN=1,FUN=psdCI,ptbl=ipsd,n=n,conf.level=1-0.05/6)) -colnames(bcis) <- c("Estimate","95% LCI","95% UCI") -bcis
    #> Estimate 95% LCI 95% UCI +bcis <- t(apply(imat,MARGIN=1,FUN=psdCI,ptbl=ipsd,n=n,conf.level=1-0.05/6)) +colnames(bcis) <- c("Estimate","95% LCI","95% UCI") +bcis +
    #> Estimate 95% LCI 95% UCI #> PSD S-Q 13.0 10.5 16.1 #> PSD Q-P 49.2 45.1 53.4 #> PSD P-M 25.4 21.9 29.2 @@ -262,7 +272,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/psdCalc.html b/docs/reference/psdCalc.html index d797375e..32205aa9 100644 --- a/docs/reference/psdCalc.html +++ b/docs/reference/psdCalc.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,21 +128,21 @@

    Convenience function for calculating PSD-X and PSD X-Y values.

    Convenience function for calculating (traditional) PSD-X and (incremental) PSD X-Y values for all Gabelhouse lengths and increments thereof.

    -
    psdCalc(
    -  formula,
    -  data,
    -  species,
    -  units = c("mm", "cm", "in"),
    -  method = c("multinomial", "binomial"),
    -  conf.level = 0.95,
    -  addLens = NULL,
    -  addNames = NULL,
    -  justAdds = FALSE,
    -  what = c("all", "traditional", "incremental", "none"),
    -  drop0Est = TRUE,
    -  showIntermediate = FALSE,
    -  digits = 0
    -)
    +
    psdCalc(
    +  formula,
    +  data,
    +  species,
    +  units = c("mm", "cm", "in"),
    +  method = c("multinomial", "binomial"),
    +  conf.level = 0.95,
    +  addLens = NULL,
    +  addNames = NULL,
    +  justAdds = FALSE,
    +  what = c("all", "traditional", "incremental", "none"),
    +  drop0Est = TRUE,
    +  showIntermediate = FALSE,
    +  digits = 0
    +)

    Arguments

    @@ -216,7 +216,7 @@

    <

    6-Size Structure.

    References

    -

    Ogle, D.H2016Introductory Fisheries Analyses with RChapman & Hall/CRC, Boca Raton, FL.

    +

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

    Guy, C.S., R.M. Neumann, and D.W. Willis2006New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS)Fisheries 31:86-87 [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.]

    Guy, C.S., R.M. Neumann, D.W. Willis, and R.O. Anderson2006Proportional size distribution (PSD): A further refinement of population size structure index terminologyFisheries 32:348[Was (is?) from http://pubstorage.sdstate.edu/wfs/450-F.pdf.]

    Neumann, R. M. and Allen, M. S2007Size structure. In Guy, C. S. and Brown, M. L., editors, Analysis and Interpretation of Freshwater Fisheries Data, Chapter 9, pages 375-421. American Fisheries Society, Bethesda, MD.

    @@ -224,15 +224,19 @@

    R

    See also

    See psdVal, psdPlot, psdAdd, PSDlit, tictactoe, lencat, and rcumsum for related functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Random length data # suppose this is yellow perch to the nearest mm -yepdf <- data.frame(yepmm=round(c(rnorm(100,mean=125,sd=15), - rnorm(50,mean=200,sd=25), - rnorm(20,mean=300,sd=40)),0), - species=rep("Yellow Perch",170)) -psdCalc(~yepmm,data=yepdf,species="Yellow perch",digits=1)
    #> Warning: Some category sample size <20, some CI coverage may be +yepdf <- data.frame(yepmm=round(c(rnorm(100,mean=125,sd=15), + rnorm(50,mean=200,sd=25), + rnorm(20,mean=300,sd=40)),0), + species=rep("Yellow Perch",170)) +psdCalc(~yepmm,data=yepdf,species="Yellow perch",digits=1) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-Q 37.1 22.6 51.7 #> PSD-P 19.0 7.2 30.9 @@ -241,7 +245,8 @@

    Examp #> PSD S-Q 62.9 48.3 77.4 #> PSD Q-P 18.1 6.5 29.7 #> PSD P-M 11.4 1.9 21.0 -#> PSD M-T 6.7 0.0 14.2

    psdCalc(~yepmm,data=yepdf,species="Yellow perch",digits=1,drop0Est=TRUE)
    #> Warning: Some category sample size <20, some CI coverage may be +#> PSD M-T 6.7 0.0 14.2
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",digits=1,drop0Est=TRUE) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-Q 37.1 22.6 51.7 #> PSD-P 19.0 7.2 30.9 @@ -252,7 +257,8 @@

    Examp #> PSD P-M 11.4 1.9 21.0 #> PSD M-T 6.7 0.0 14.2

    ## add a length -psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150)
    #> Warning: Some category sample size <20, some CI coverage may be +psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-150 70 56 85 #> PSD-Q 37 21 53 @@ -265,7 +271,8 @@

    Examp #> PSD P-M 11 1 22 #> PSD M-T 7 0 15

    ## add lengths with names -psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,addNames="minLen")
    #> Warning: Some category sample size <20, some CI coverage may be +psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,addNames="minLen") +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-minLen 70 56 85 #> PSD-Q 37 21 53 @@ -276,7 +283,8 @@

    Examp #> PSD minLen-Q 33 18 49 #> PSD Q-P 18 6 31 #> PSD P-M 11 1 22 -#> PSD M-T 7 0 15

    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150))
    #> Warning: Some category sample size <20, some CI coverage may be +#> PSD M-T 7 0 15
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150)) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-minLen 70 56 85 #> PSD-Q 37 21 53 @@ -287,7 +295,8 @@

    Examp #> PSD minLen-Q 33 18 49 #> PSD Q-P 18 6 31 #> PSD P-M 11 1 22 -#> PSD M-T 7 0 15

    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c(150,275),addNames=c("minSlot","maxSlot"))
    #> Warning: Some category sample size <20, some CI coverage may be +#> PSD M-T 7 0 15
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c(150,275),addNames=c("minSlot","maxSlot")) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-minSlot 70 55 86 #> PSD-Q 37 20 54 @@ -300,7 +309,8 @@

    Examp #> PSD Q-P 18 5 31 #> PSD P-maxSlot 4 0 10 #> PSD maxSlot-M 8 0 17 -#> PSD M-T 7 0 15

    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150,"maxslot"=275))
    #> Warning: Some category sample size <20, some CI coverage may be +#> PSD M-T 7 0 15
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150,"maxslot"=275)) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-minLen 70 55 86 #> PSD-Q 37 20 54 @@ -315,43 +325,51 @@

    Examp #> PSD maxslot-M 8 0 17 #> PSD M-T 7 0 15

    ## add lengths with names, return just those values that use those lengths -psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150),justAdds=TRUE)
    #> Warning: Some category sample size <20, some CI coverage may be +psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150),justAdds=TRUE) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-minLen 70 56 85 #> PSD S-minLen 30 15 44 -#> PSD minLen-Q 33 18 49
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150),justAdds=TRUE, - what="traditional")
    #> Warning: Some category sample size <20, some CI coverage may be +#> PSD minLen-Q 33 18 49
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150),justAdds=TRUE, + what="traditional") +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI -#> 70 56 85
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c(150,275), - addNames=c("minSlot","maxSlot"),justAdds=TRUE)
    #> Warning: Some category sample size <20, some CI coverage may be +#> 70 56 85
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c(150,275), + addNames=c("minSlot","maxSlot"),justAdds=TRUE) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-minSlot 70 55 86 #> PSD-maxSlot 15 3 28 #> PSD S-minSlot 30 14 45 #> PSD minSlot-Q 33 17 50 #> PSD P-maxSlot 4 0 10 -#> PSD maxSlot-M 8 0 17
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c(150,275), - addNames=c("minSlot","maxSlot"),justAdds=TRUE,what="traditional")
    #> Warning: Some category sample size <20, some CI coverage may be +#> PSD maxSlot-M 8 0 17
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c(150,275), + addNames=c("minSlot","maxSlot"),justAdds=TRUE,what="traditional") +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-minSlot 70 55 86 #> PSD-maxSlot 15 3 28
    ## different output types -psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,what="traditional")
    #> Warning: Some category sample size <20, some CI coverage may be +psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,what="traditional") +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-150 70 56 85 #> PSD-Q 37 21 53 #> PSD-P 19 6 32 #> PSD-M 8 0 16 -#> PSD-T 1 0 4
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,what="incremental")
    #> Warning: Some category sample size <20, some CI coverage may be +#> PSD-T 1 0 4
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,what="incremental") +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD S-150 30 15 44 #> PSD 150-Q 33 18 49 #> PSD Q-P 18 6 31 #> PSD P-M 11 1 22 -#> PSD M-T 7 0 15
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,what="none")
    #> Warning: Some category sample size <20, some CI coverage may be +#> PSD M-T 7 0 15
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,what="none") +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    ## Show intermediate values -psdCalc(~yepmm,data=yepdf,species="Yellow perch",showInterm=TRUE)
    #> Warning: Some category sample size <20, some CI coverage may be +psdCalc(~yepmm,data=yepdf,species="Yellow perch",showInterm=TRUE) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> num stock Estimate 95% LCI 95% UCI #> PSD-Q 39 105 37 23 52 #> PSD-P 20 105 19 7 31 @@ -360,19 +378,22 @@

    Examp #> PSD S-Q 66 105 63 48 77 #> PSD Q-P 19 105 18 7 30 #> PSD P-M 12 105 11 2 21 -#> PSD M-T 7 105 7 0 14

    psdCalc(~yepmm,data=yepdf,species="Yellow perch",what="traditional",showInterm=TRUE)
    #> Warning: Some category sample size <20, some CI coverage may be +#> PSD M-T 7 105 7 0 14
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",what="traditional",showInterm=TRUE) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> num stock Estimate 95% LCI 95% UCI #> PSD-Q 39 105 37 23 52 #> PSD-P 20 105 19 7 31 #> PSD-M 8 105 8 0 16 -#> PSD-T 1 105 1 0 4
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",what="incremental",showInterm=TRUE)
    #> Warning: Some category sample size <20, some CI coverage may be +#> PSD-T 1 105 1 0 4
    psdCalc(~yepmm,data=yepdf,species="Yellow perch",what="incremental",showInterm=TRUE) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> num stock Estimate 95% LCI 95% UCI #> PSD S-Q 66 105 63 48 77 #> PSD Q-P 19 105 18 7 30 #> PSD P-M 12 105 11 2 21 #> PSD M-T 7 105 7 0 14
    ## Control the digits -psdCalc(~yepmm,data=yepdf,species="Yellow perch",digits=1)
    #> Warning: Some category sample size <20, some CI coverage may be +psdCalc(~yepmm,data=yepdf,species="Yellow perch",digits=1) +
    #> Warning: Some category sample size <20, some CI coverage may be #> lower than 95%.
    #> Estimate 95% LCI 95% UCI #> PSD-Q 37.1 22.6 51.7 #> PSD-P 19.0 7.2 30.9 @@ -398,7 +419,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/psdPlot-1.png b/docs/reference/psdPlot-1.png index f2f7e541..ffdb4eef 100644 Binary files a/docs/reference/psdPlot-1.png and b/docs/reference/psdPlot-1.png differ diff --git a/docs/reference/psdPlot-2.png b/docs/reference/psdPlot-2.png index 52c2288f..0a193e9e 100644 Binary files a/docs/reference/psdPlot-2.png and b/docs/reference/psdPlot-2.png differ diff --git a/docs/reference/psdPlot-3.png b/docs/reference/psdPlot-3.png index e2e48bb4..f8111d04 100644 Binary files a/docs/reference/psdPlot-3.png and b/docs/reference/psdPlot-3.png differ diff --git a/docs/reference/psdPlot-4.png b/docs/reference/psdPlot-4.png index 96a3b898..d2cc6778 100644 Binary files a/docs/reference/psdPlot-4.png and b/docs/reference/psdPlot-4.png differ diff --git a/docs/reference/psdPlot-5.png b/docs/reference/psdPlot-5.png index dc9b4c24..9c9c8d15 100644 Binary files a/docs/reference/psdPlot-5.png and b/docs/reference/psdPlot-5.png differ diff --git a/docs/reference/psdPlot-6.png b/docs/reference/psdPlot-6.png index 3fbde37f..5cad2016 100644 Binary files a/docs/reference/psdPlot-6.png and b/docs/reference/psdPlot-6.png differ diff --git a/docs/reference/psdPlot-7.png b/docs/reference/psdPlot-7.png index 38e65a1d..6ac9a3d9 100644 Binary files a/docs/reference/psdPlot-7.png and b/docs/reference/psdPlot-7.png differ diff --git a/docs/reference/psdPlot-8.png b/docs/reference/psdPlot-8.png index 9eb8ced0..00a05c24 100644 Binary files a/docs/reference/psdPlot-8.png and b/docs/reference/psdPlot-8.png differ diff --git a/docs/reference/psdPlot-9.png b/docs/reference/psdPlot-9.png index 171867e2..93e515b4 100644 Binary files a/docs/reference/psdPlot-9.png and b/docs/reference/psdPlot-9.png differ diff --git a/docs/reference/psdPlot.html b/docs/reference/psdPlot.html index 77c92cbb..09c24868 100644 --- a/docs/reference/psdPlot.html +++ b/docs/reference/psdPlot.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,30 +128,30 @@

    Length-frequency histogram with Gabelhouse lengths highlighted.

    Constructs a length-frequency histogram with Gabelhouse lengths highlighted.

    -
    psdPlot(
    -  formula,
    -  data,
    -  species = "List",
    -  units = c("mm", "cm", "in"),
    -  startcat = 0,
    -  w = 1,
    -  justPSDQ = FALSE,
    -  main = "",
    -  xlab = "Length",
    -  ylab = "Number",
    -  xlim = NULL,
    -  ylim = c(0, max(h$counts)),
    -  substock.col = "white",
    -  stock.col = "gray90",
    -  psd.col = "black",
    -  psd.lty = 2,
    -  psd.lwd = 1,
    -  show.abbrevs = TRUE,
    -  psd.add = TRUE,
    -  psd.pos = "topleft",
    -  psd.cex = 0.75,
    -  ...
    -)
    +
    psdPlot(
    +  formula,
    +  data,
    +  species = "List",
    +  units = c("mm", "cm", "in"),
    +  startcat = 0,
    +  w = 1,
    +  justPSDQ = FALSE,
    +  main = "",
    +  xlab = "Length",
    +  ylab = "Number",
    +  xlim = NULL,
    +  ylim = c(0, max(h$counts)),
    +  substock.col = "white",
    +  stock.col = "gray90",
    +  psd.col = "black",
    +  psd.lty = 2,
    +  psd.lwd = 1,
    +  show.abbrevs = TRUE,
    +  psd.add = TRUE,
    +  psd.pos = "topleft",
    +  psd.cex = 0.75,
    +  ...
    +)

    Arguments

    @@ -258,48 +258,62 @@

    <

    6-Size Structure.

    References

    -

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

    +

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

    Guy, C.S., R.M. Neumann, and D.W. Willis. 2006. New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS). Fisheries 31:86-87. [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.]

    Guy, C.S., R.M. Neumann, D.W. Willis, and R.O. Anderson. 2006. Proportional size distribution (PSD): A further refinement of population size structure index terminology. Fisheries 32:348. [Was (is?) from http://pubstorage.sdstate.edu/wfs/450-F.pdf.]

    Willis, D.W., B.R. Murphy, and C.S. Guy. 1993. Stock density indices: development, use, and limitations. Reviews in Fisheries Science 1:203-222. [Was (is?) from http://web1.cnre.vt.edu/murphybr/web/Readings/Willis%20et%20al.pdf.]

    See also

    See psdVal, psdCalc, psdAdd, PSDlit, lencat, tictactoe, lencat, and rcumsum for related functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Random length data # suppose this is yellow perch to the nearest mm -mm <- c(rnorm(100,mean=125,sd=15),rnorm(50,mean=200,sd=25), - rnorm(20,mean=300,sd=40)) +mm <- c(rnorm(100,mean=125,sd=15),rnorm(50,mean=200,sd=25), + rnorm(20,mean=300,sd=40)) # same data to the nearest 0.1 cm -cm <- mm/10 +cm <- mm/10 # same data to the nearest 0.1 in -inch <- mm/25.4 +inch <- mm/25.4 # put together as data.frame -df <- data.frame(mm,cm,inch) +df <- data.frame(mm,cm,inch) ## Example graphics -op <- par(mar=c(3,3,2,1),mgp=c(1.7,0.5,0)) +op <- par(mar=c(3,3,2,1),mgp=c(1.7,0.5,0)) # mm data using 10-mm increments -psdPlot(~mm,data=df,species="Yellow perch",w=10)
    # cm data using 1-cm increments -psdPlot(~cm,data=df,species="Yellow perch",units="cm",w=1)
    # inch data using 1-in increments -psdPlot(~inch,data=df,species="Yellow perch",units="in",w=1)
    # same as first with some color changes -psdPlot(~mm,data=df,species="Yellow perch",w=10,substock.col="gray90", - stock.col="gray30")
    # ... but without the PSD values -psdPlot(~mm,data=df,species="Yellow perch",w=10,psd.add=FALSE)
    # ... demonstrate use of xlim -psdPlot(~mm,data=df,species="Yellow perch",w=10,xlim=c(100,300))
    +psdPlot(~mm,data=df,species="Yellow perch",w=10) +
    # cm data using 1-cm increments +psdPlot(~cm,data=df,species="Yellow perch",units="cm",w=1) +
    # inch data using 1-in increments +psdPlot(~inch,data=df,species="Yellow perch",units="in",w=1) +
    # same as first with some color changes +psdPlot(~mm,data=df,species="Yellow perch",w=10,substock.col="gray90", + stock.col="gray30") +
    # ... but without the PSD values +psdPlot(~mm,data=df,species="Yellow perch",w=10,psd.add=FALSE) +
    # ... demonstrate use of xlim +psdPlot(~mm,data=df,species="Yellow perch",w=10,xlim=c(100,300)) +
    ## different subsets of fish # ... without any sub-stock fish -brks <- psdVal("Yellow Perch") -tmp <- filterD(df,mm>brks["stock"]) -psdPlot(~mm,data=tmp,species="Yellow perch",w=10)
    # ... without any sub-stock or stock fish -tmp <- filterD(df,mm>brks["quality"]) -psdPlot(~mm,data=tmp,species="Yellow perch",w=10)
    # ... with only sub-stock, stock, and quality fish ... only PSD-Q -tmp <- filterD(df,mm<brks["preferred"]) -psdPlot(~mm,data=tmp,species="Yellow perch",w=10)
    # ... with only sub-stock fish (don't run ... setup to give an error) -tmp <- filterD(df,mm<brks["stock"]) -if (FALSE) psdPlot(~mm,data=tmp,species="Yellow perch",w=10) -par(op)
    +brks<-psdVal("Yellow Perch") +tmp<-filterD(df,mm>brks["stock"]) +psdPlot(~mm,data=tmp,species="Yellow perch",w=10) +
    # ... without any sub-stock or stock fish +tmp <- filterD(df,mm>brks["quality"]) +psdPlot(~mm,data=tmp,species="Yellow perch",w=10) +
    # ... with only sub-stock, stock, and quality fish ... only PSD-Q +tmp <- filterD(df,mm<brks["preferred"]) +psdPlot(~mm,data=tmp,species="Yellow perch",w=10) +
    # ... with only sub-stock fish (don't run ... setup to give an error) +tmp <- filterD(df,mm<brks["stock"]) +if (FALSE) psdPlot(~mm,data=tmp,species="Yellow perch",w=10) +par(op) + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/psdVal.html b/docs/reference/psdVal.html index 5f32ee2a..d803474a 100644 --- a/docs/reference/psdVal.html +++ b/docs/reference/psdVal.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,13 +128,13 @@

    Finds Gabelhouse lengths (for PSD calculations) for a species.

    Returns a vector with the five Gabelhouse lengths for a chosen species.

    -
    psdVal(
    -  species = "List",
    -  units = c("mm", "cm", "in"),
    -  incl.zero = TRUE,
    -  addLens = NULL,
    -  addNames = NULL
    -)
    +
    psdVal(
    +  species = "List",
    +  units = c("mm", "cm", "in"),
    +  incl.zero = TRUE,
    +  addLens = NULL,
    +  addNames = NULL
    +)

    Arguments

    @@ -174,17 +174,21 @@

    <

    6-Size Structure.

    References

    -

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

    +

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

    Guy, C.S., R.M. Neumann, and D.W. Willis. 2006. New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS). Fisheries 31:86-87. [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.]

    Guy, C.S., R.M. Neumann, D.W. Willis, and R.O. Anderson. 2006. Proportional size distribution (PSD): A further refinement of population size structure index terminology. Fisheries 32:348. [Was (is?) from http://pubstorage.sdstate.edu/wfs/450-F.pdf.]

    Willis, D.W., B.R. Murphy, and C.S. Guy. 1993. Stock density indices: development, use, and limitations. Reviews in Fisheries Science 1:203-222. [Was (is?) from http://web1.cnre.vt.edu/murphybr/web/Readings/Willis%20et%20al.pdf.]

    See also

    See psdCalc, psdPlot, psdAdd, PSDlit, tictactoe, lencat, and rcumsum for related functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    # List all of the species -psdVal()
    #> +psdVal() +
    #> #> Species name must be one of following. Be careful of spelling and capitalization.
    #> [1] "Arctic Grayling" "Bighead Carp" #> [3] "Bigmouth Buffalo" "Black Bullhead" #> [5] "Black Carp" "Black Crappie" @@ -217,20 +221,32 @@

    Examp #> [59] "White Perch" "White Sucker" #> [61] "Yellow Bass" "Yellow Bullhead" #> [63] "Yellow Perch"

    # Demonstrate typical usages -psdVal("Yellow perch")
    #> substock stock quality preferred memorable trophy -#> 0 130 200 250 300 380
    psdVal("Walleye",units="cm")
    #> substock stock quality preferred memorable trophy -#> 0 25 38 51 63 76
    psdVal("Bluegill",units="in")
    #> substock stock quality preferred memorable trophy -#> 0 3 6 8 10 12
    psdVal("Bluegill",units="in",incl.zero=FALSE)
    #> stock quality preferred memorable trophy -#> 3 6 8 10 12
    psdVal("Bluegill")
    #> substock stock quality preferred memorable trophy +psdVal("Yellow perch") +
    #> substock stock quality preferred memorable trophy +#> 0 130 200 250 300 380
    psdVal("Walleye",units="cm") +
    #> substock stock quality preferred memorable trophy +#> 0 25 38 51 63 76
    psdVal("Bluegill",units="in") +
    #> substock stock quality preferred memorable trophy +#> 0 3 6 8 10 12
    psdVal("Bluegill",units="in",incl.zero=FALSE) +
    #> stock quality preferred memorable trophy +#> 3 6 8 10 12
    psdVal("Bluegill") +
    #> substock stock quality preferred memorable trophy #> 0 80 150 200 250 300
    # Demonstrate that it will work with mis-capitalization -psdVal("bluegill")
    #> substock stock quality preferred memorable trophy -#> 0 80 150 200 250 300
    psdVal("Yellow Perch")
    #> substock stock quality preferred memorable trophy +psdVal("bluegill") +
    #> substock stock quality preferred memorable trophy +#> 0 80 150 200 250 300
    psdVal("Yellow Perch") +
    #> substock stock quality preferred memorable trophy #> 0 130 200 250 300 380
    # Demonstrate adding in user-defined categories -psdVal("Bluegill",units="in",addLens=7)
    #> substock stock quality 7 preferred memorable trophy -#> 0 3 6 7 8 10 12
    psdVal("Bluegill",units="in",addLens=7,addNames="MinLen")
    #> substock stock quality MinLen preferred memorable trophy -#> 0 3 6 7 8 10 12
    psdVal("Bluegill",units="in",addLens=c(7,9),addNames=c("MinSlot","MaxSlot"))
    #> substock stock quality MinSlot preferred MaxSlot memorable trophy -#> 0 3 6 7 8 9 10 12
    psdVal("Bluegill",units="in",addLens=c("MinLen"=7))
    #> substock stock quality MinLen preferred memorable trophy -#> 0 3 6 7 8 10 12
    psdVal("Bluegill",units="in",addLens=c("MinSlot"=7,"MaxSlot"=9))
    #> substock stock quality MinSlot preferred MaxSlot memorable trophy +psdVal("Bluegill",units="in",addLens=7) +
    #> substock stock quality 7 preferred memorable trophy +#> 0 3 6 7 8 10 12
    psdVal("Bluegill",units="in",addLens=7,addNames="MinLen") +
    #> substock stock quality MinLen preferred memorable trophy +#> 0 3 6 7 8 10 12
    psdVal("Bluegill",units="in",addLens=c(7,9),addNames=c("MinSlot","MaxSlot")) +
    #> substock stock quality MinSlot preferred MaxSlot memorable trophy +#> 0 3 6 7 8 9 10 12
    psdVal("Bluegill",units="in",addLens=c("MinLen"=7)) +
    #> substock stock quality MinLen preferred memorable trophy +#> 0 3 6 7 8 10 12
    psdVal("Bluegill",units="in",addLens=c("MinSlot"=7,"MaxSlot"=9)) +
    #> substock stock quality MinSlot preferred MaxSlot memorable trophy #> 0 3 6 7 8 9 10 12
    @@ -248,7 +264,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/rSquared.html b/docs/reference/rSquared.html index ce4ec559..ea5a4dc3 100644 --- a/docs/reference/rSquared.html +++ b/docs/reference/rSquared.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,13 +128,13 @@

    Extract the coefficient of determination from a linear model object.

    Extracts the coefficient of determination (i.e., “r-squared”) from a linear model (i.e., lm) object.

    -
    rSquared(object, ...)
    +    
    rSquared(object, ...)
     
     # S3 method for default
    -rSquared(object, ...)
    +rSquared(object, ...)
     
     # S3 method for lm
    -rSquared(object, digits = getOption("digits"), percent = FALSE, ...)
    +rSquared(object, digits = getOption("digits"), percent = FALSE, ...)

    Arguments

    @@ -165,13 +165,18 @@

    Details

    This is a convenience function to extract the r.squared part from summary(lm).

    Examples

    -
    lm1 <- lm(mirex~weight, data=Mirex) -rSquared(lm1)
    #> [1] 0.1812022
    rSquared(lm1,digits=3)
    #> [1] 0.181
    rSquared(lm1,digits=1,percent=TRUE)
    #> [1] 18.1
    +
    lm1 <- lm(mirex~weight, data=Mirex) +rSquared(lm1) +
    #> [1] 0.1812022
    rSquared(lm1,digits=3) +
    #> [1] 0.181
    rSquared(lm1,digits=1,percent=TRUE) +
    #> [1] 18.1
    ## rSquared only works with lm objects -if (FALSE) { -nls1 <- nls(mirex~a*weight^b,data=Mirex,start=list(a=1,b=1)) -rSquared(nls1) -}
    +if (FALSE) { +nls1 <- nls(mirex~a*weight^b,data=Mirex,start=list(a=1,b=1)) +rSquared(nls1) +} + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/rcumsum.html b/docs/reference/rcumsum.html index 7c7a413f..c122925d 100644 --- a/docs/reference/rcumsum.html +++ b/docs/reference/rcumsum.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,9 +128,9 @@

    Computes the prior to or reverse cumulative sum of a vector.

    Computes the prior-to (i.e., the cumulative sum prior to but not including the current value) or the reverse (i.e., the number that large or larger) cumulative sum of a vector. Also works for 1-dimensional tables, matrices, and data.frames, though it is best used with vectors.

    -
    rcumsum(x)
    +    
    rcumsum(x)
     
    -pcumsum(x)
    +pcumsum(x)

    Arguments

    @@ -150,13 +150,17 @@

    Note

    See also

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Simple example -cbind(vals=1:10, - cum=cumsum(1:10), - pcum=pcumsum(1:10), - rcum=rcumsum(1:10))
    #> vals cum pcum rcum +cbind(vals=1:10, + cum=cumsum(1:10), + pcum=pcumsum(1:10), + rcum=rcumsum(1:10)) +
    #> vals cum pcum rcum #> [1,] 1 1 0 55 #> [2,] 2 3 1 54 #> [3,] 3 6 3 52 @@ -168,43 +172,54 @@

    Examp #> [9,] 9 45 36 19 #> [10,] 10 55 45 10

    ## Example with NA -vals <- c(1,2,NA,3) -cbind(vals, - cum=cumsum(vals), - pcum=pcumsum(vals), - rcum=rcumsum(vals))
    #> vals cum pcum rcum +vals <- c(1,2,NA,3) +cbind(vals, + cum=cumsum(vals), + pcum=pcumsum(vals), + rcum=rcumsum(vals)) +
    #> vals cum pcum rcum #> [1,] 1 1 0 NA #> [2,] 2 3 1 NA #> [3,] NA NA NA NA #> [4,] 3 NA NA 3
    ## Example with NA -vals <- c(1,2,NA,3,NA,4) -cbind(vals, - cum=cumsum(vals), - pcum=pcumsum(vals), - rcum=rcumsum(vals))
    #> vals cum pcum rcum +vals <- c(1,2,NA,3,NA,4) +cbind(vals, + cum=cumsum(vals), + pcum=pcumsum(vals), + rcum=rcumsum(vals)) +
    #> vals cum pcum rcum #> [1,] 1 1 0 NA #> [2,] 2 3 1 NA #> [3,] NA NA NA NA #> [4,] 3 NA NA NA #> [5,] NA NA NA NA -#> [6,] 4 NA NA 4
    +#> [6,] 4 NA NA 4
    ## Example with a matrix -mat <- matrix(c(1,2,3,4,5),nrow=1) -cumsum(mat)
    #> [1] 1 3 6 10 15
    pcumsum(mat)
    #> [,1] [,2] [,3] [,4] [,5] -#> [1,] 0 1 3 6 10
    rcumsum(mat)
    #> [1] 15 14 12 9 5
    +mat <- matrix(c(1,2,3,4,5),nrow=1) +cumsum(mat) +
    #> [1] 1 3 6 10 15
    pcumsum(mat) +
    #> [,1] [,2] [,3] [,4] [,5] +#> [1,] 0 1 3 6 10
    rcumsum(mat) +
    #> [1] 15 14 12 9 5
    ## Example with a table (must be 1-d) -df <- sample(1:10,100,replace=TRUE) -tbl <- table(df) -cumsum(tbl)
    #> 1 2 3 4 5 6 7 8 9 10 -#> 12 23 34 43 51 59 65 78 87 100
    pcumsum(tbl)
    #> df +df <- sample(1:10,100,replace=TRUE) +tbl <- table(df) +cumsum(tbl) +
    #> 1 2 3 4 5 6 7 8 9 10 +#> 12 23 34 43 51 59 65 78 87 100
    pcumsum(tbl) +
    #> df #> 1 2 3 4 5 6 7 8 9 10 -#> 0 12 23 34 43 51 59 65 78 87
    rcumsum(tbl)
    #> 1 2 3 4 5 6 7 8 9 10 +#> 0 12 23 34 43 51 59 65 78 87
    rcumsum(tbl) +
    #> 1 2 3 4 5 6 7 8 9 10 #> 100 88 77 66 57 49 41 35 22 13
    ## Example with a data.frame (must be 1-d) -df <- sample(1:10,100,replace=TRUE) -tbl <- as.data.frame(table(df))[,-1] -cumsum(tbl)
    #> [1] 4 17 26 38 47 54 73 82 93 100
    pcumsum(tbl)
    #> [1] 0 4 17 26 38 47 54 73 82 93
    rcumsum(tbl)
    #> [1] 100 96 83 74 62 53 46 27 18 7
    +df<-sample(1:10,100,replace=TRUE) +tbl<-as.data.frame(table(df))[,-1] +cumsum(tbl) +
    #> [1] 4 17 26 38 47 54 73 82 93 100
    pcumsum(tbl) +
    #> [1] 0 4 17 26 38 47 54 73 82 93
    rcumsum(tbl) +
    #> [1] 100 96 83 74 62 53 46 27 18 7
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/removal.html b/docs/reference/removal.html index 1b239009..334770c8 100644 --- a/docs/reference/removal.html +++ b/docs/reference/removal.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,38 +128,38 @@

    Population estimates for k-, 3-, or 2-pass removal data.

    Computes estimates, with confidence intervals, of the population size and probability of capture from the number of fish removed in k-, 3-, or 2-passes in a closed population.

    -
    removal(
    -  catch,
    -  method = c("CarleStrub", "Zippin", "Seber3", "Seber2", "RobsonRegier2", "Moran",
    -    "Schnute", "Burnham"),
    -  alpha = 1,
    -  beta = 1,
    -  CS.se = c("Zippin", "alternative"),
    -  conf.level = 0.95,
    -  just.ests = FALSE,
    -  Tmult = 3,
    -  CIMicroFish = FALSE
    -)
    +    
    removal(
    +  catch,
    +  method = c("CarleStrub", "Zippin", "Seber3", "Seber2", "RobsonRegier2", "Moran",
    +    "Schnute", "Burnham"),
    +  alpha = 1,
    +  beta = 1,
    +  CS.se = c("Zippin", "alternative"),
    +  conf.level = 0.95,
    +  just.ests = FALSE,
    +  Tmult = 3,
    +  CIMicroFish = FALSE
    +)
     
     # S3 method for removal
    -summary(
    -  object,
    -  parm = c("No", "p", "p1"),
    -  digits = getOption("digits"),
    -  verbose = FALSE,
    -  ...
    -)
    +summary(
    +  object,
    +  parm = c("No", "p", "p1"),
    +  digits = getOption("digits"),
    +  verbose = FALSE,
    +  ...
    +)
     
     # S3 method for removal
    -confint(
    -  object,
    -  parm = c("No", "p"),
    -  level = conf.level,
    -  conf.level = NULL,
    -  digits = getOption("digits"),
    -  verbose = FALSE,
    -  ...
    -)
    +confint( + object, + parm = c("No", "p"), + level = conf.level, + conf.level = NULL, + digits = getOption("digits"), + verbose = FALSE, + ... +)

    Arguments

    @@ -270,7 +270,7 @@

    <

    10-Abundance from Depletion Data.

    References

    -

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

    +

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

    Carle, F.L. and M.R. Strub. 1978. A new method for estimating population size from removal data. Biometrics, 34:621-630.

    Cowx, I.G. 1983. Review of the methods for estimating fish population size from survey removal data. Fisheries Management, 14:67-82.

    Moran, P.A.P. 1951. A mathematical theory of animal trapping. Biometrika 38:307-311.

    @@ -283,72 +283,99 @@

    R

    See also

    See depletion for related functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    +

    A. Powell Wheeler, powell.wheeler@gmail.com

    Examples

    ## First example -- 3 passes -ct3 <- c(77,50,37) +ct3 <- c(77,50,37) # Carle Strub (default) method -p1 <- removal(ct3) -summary(p1)
    #> Estimate Std. Error +p1 <- removal(ct3) +summary(p1) +
    #> Estimate Std. Error #> No 233.0000000 31.3578504 -#> p 0.3313131 0.0666816
    summary(p1,verbose=TRUE)
    #> The Carle & Strub (1978) K-Pass Removal Method was used.
    #> Estimate Std. Error +#> p 0.3313131 0.0666816
    summary(p1,verbose=TRUE) +
    #> The Carle & Strub (1978) K-Pass Removal Method was used.
    #> Estimate Std. Error #> No 233.0000000 31.3578504 -#> p 0.3313131 0.0666816
    summary(p1,parm="No")
    #> Estimate Std. Error -#> No 233 31.35785
    summary(p1,parm="p")
    #> Estimate Std. Error -#> p 0.3313131 0.0666816
    #> 95% LCI 95% UCI +#> p 0.3313131 0.0666816
    summary(p1,parm="No") +
    #> Estimate Std. Error +#> No 233 31.35785
    summary(p1,parm="p") +
    #> Estimate Std. Error +#> p 0.3313131 0.0666816
    confint(p1) +
    #> 95% LCI 95% UCI #> No 171.5397426 294.4602574 -#> p 0.2006195 0.4620067
    confint(p1,parm="No")
    #> 95% LCI 95% UCI -#> No 171.5397 294.4603
    confint(p1,parm="p")
    #> 95% LCI 95% UCI +#> p 0.2006195 0.4620067
    confint(p1,parm="No") +
    #> 95% LCI 95% UCI +#> No 171.5397 294.4603
    confint(p1,parm="p") +
    #> 95% LCI 95% UCI #> p 0.2006195 0.4620067
    # Moran method -p2 <- removal(ct3,method="Moran") -summary(p2,verbose=TRUE)
    #> The Moran (1951) K-Pass Removal Method was used (SEs not computed).
    #> Estimate +p2 <- removal(ct3,method="Moran") +summary(p2,verbose=TRUE) +
    #> The Moran (1951) K-Pass Removal Method was used (SEs not computed).
    #> Estimate #> No 237.5965440 -#> p 0.3223336
    confint(p2,verbose=TRUE)
    #> 95% LCI 95% UCI +#> p 0.3223336
    confint(p2,verbose=TRUE) +
    #> 95% LCI 95% UCI #> No 194.7 370.9
    #' # Schnute method -p3 <- removal(ct3,method="Schnute") -summary(p3,verbose=TRUE)
    #> The Schnute (1983) K-Pass Removal Method w/ Non-constant Initial Catchability was used (SEs not computed).
    #> Estimate +p3 <- removal(ct3,method="Schnute") +summary(p3,verbose=TRUE) +
    #> The Schnute (1983) K-Pass Removal Method w/ Non-constant Initial Catchability was used (SEs not computed).
    #> Estimate #> No 245.0955550 #> p 0.3039927 -#> p1 0.3141632
    confint(p3,verbose=TRUE)
    #> An upper confidence value for 'No' cannot be determined.
    #> 95% LCI 95% UCI +#> p1 0.3141632
    confint(p3,verbose=TRUE) +
    #> An upper confidence value for 'No' cannot be determined.
    #> 95% LCI 95% UCI #> No 183.9 Inf
    # Burnham method -p4 <- removal(ct3,method="Burnham") -summary(p4)
    #> Estimate Std. Error +p4 <- removal(ct3,method="Burnham") +summary(p4) +
    #> Estimate Std. Error #> No 238.0000000 33.8404319 -#> p 0.3215686 0.0673948
    summary(p4,verbose=TRUE)
    #> The Burnham K-Pass Removal Method (Van Deventer and Platts 1983) was used.
    #> Estimate Std. Error +#> p 0.3215686 0.0673948
    summary(p4,verbose=TRUE) +
    #> The Burnham K-Pass Removal Method (Van Deventer and Platts 1983) was used.
    #> Estimate Std. Error #> No 238.0000000 33.8404319 -#> p 0.3215686 0.0673948
    summary(p4,parm="No")
    #> Estimate Std. Error -#> No 238 33.84043
    summary(p4,parm="p")
    #> Estimate Std. Error -#> p 0.3215686 0.0673948
    #> 95% LCI 95% UCI +#> p 0.3215686 0.0673948
    summary(p4,parm="No") +
    #> Estimate Std. Error +#> No 238 33.84043
    summary(p4,parm="p") +
    #> Estimate Std. Error +#> p 0.3215686 0.0673948
    confint(p4) +
    #> 95% LCI 95% UCI #> No 171.3335366 304.6664634 -#> p 0.1887992 0.4543381
    confint(p4,parm="No")
    #> 95% LCI 95% UCI -#> No 171.3335 304.6665
    confint(p4,parm="p")
    #> 95% LCI 95% UCI +#> p 0.1887992 0.4543381
    confint(p4,parm="No") +
    #> 95% LCI 95% UCI +#> No 171.3335 304.6665
    confint(p4,parm="p") +
    #> 95% LCI 95% UCI #> p 0.1887992 0.4543381
    ## Second example -- 2 passes -ct2 <- c(77,37) +ct2 <- c(77,37) # Seber method -p4 <- removal(ct2,method="Seber2") -summary(p4,verbose=TRUE)
    #> The Seber (2002) 2-Pass Removal Method was used.
    #> Estimate Std. Error +p4 <- removal(ct2,method="Seber2") +summary(p4,verbose=TRUE) +
    #> The Seber (2002) 2-Pass Removal Method was used.
    #> Estimate Std. Error #> No 148.2250000 19.0118725 -#> p 0.5194805 0.0961208
    #> 95% LCI 95% UCI +#> p 0.5194805 0.0961208
    confint(p4) +
    #> 95% LCI 95% UCI #> No 110.9624147 185.4875853 #> p 0.3310873 0.7078737
    ### Test if catchability differs between first sample and the other samples # chi-square test statistic from negative log-likelihoods # from Moran and Schnute fits (from above) -chi2.val <- 2*(p2$min.nlogLH-p3$min.nlogLH) +chi2.val <- 2*(p2$min.nlogLH-p3$min.nlogLH) # p-value ... no significant difference -pchisq(chi2.val,df=1,lower.tail=FALSE)
    #> [1] 0.8882765
    +pchisq(chi2.val,df=1,lower.tail=FALSE) +
    #> [1] 0.8882765
    # Another LRT example ... sample 1 from Schnute (1983) -ct4 <- c(45,11,18,8) -p2a <- removal(ct4,method="Moran") -p3a <- removal(ct4,method="Schnute") -chi2.val <- 2*(p2a$min.nlogLH-p3a$min.nlogLH) # 4.74 in Schnute(1983) -pchisq(chi2.val,df=1,lower.tail=FALSE) # significant difference (catchability differs)
    #> [1] 0.02955309
    summary(p3a)
    #> Estimate +ct4 <- c(45,11,18,8) +p2a <- removal(ct4,method="Moran") +p3a <- removal(ct4,method="Schnute") +chi2.val <- 2*(p2a$min.nlogLH-p3a$min.nlogLH) # 4.74 in Schnute(1983) +pchisq(chi2.val,df=1,lower.tail=FALSE) # significant difference (catchability differs) +
    #> [1] 0.02955309
    summary(p3a) +
    #> Estimate #> No 123.5879686 #> p 0.1890032 #> p1 0.3641131
    @@ -356,15 +383,16 @@

    Examp ### Using lapply() to use removal() on many different groups ### with the removals in a single variable ("long format") ## create a dummy data frame -lake <- factor(rep(c("Ash Tree","Bark","Clay"),each=5)) -year <- factor(rep(c("2010","2011","2010","2011","2010","2011"),times=c(2,3,3,2,2,3))) -pass <- factor(c(1,2,1,2,3,1,2,3,1,2,1,2,1,2,3)) -catch <- c(57,34,65,34,12,54,26,9,54,27,67,34,68,35,12) -d <- data.frame(lake,year,pass,catch) +lake <- factor(rep(c("Ash Tree","Bark","Clay"),each=5)) +year <- factor(rep(c("2010","2011","2010","2011","2010","2011"),times=c(2,3,3,2,2,3))) +pass <- factor(c(1,2,1,2,3,1,2,3,1,2,1,2,1,2,3)) +catch <- c(57,34,65,34,12,54,26,9,54,27,67,34,68,35,12) +d <- data.frame(lake,year,pass,catch) ## create a variable that indicates each different group -d$group <- with(d,interaction(lake,year)) -d

    #> lake year pass catch group +d$group <- with(d,interaction(lake,year)) +d +
    #> lake year pass catch group #> 1 Ash Tree 2010 1 57 Ash Tree.2010 #> 2 Ash Tree 2010 2 34 Ash Tree.2010 #> 3 Ash Tree 2011 1 65 Ash Tree.2011 @@ -380,18 +408,19 @@

    Examp #> 13 Clay 2011 1 68 Clay.2011 #> 14 Clay 2011 2 35 Clay.2011 #> 15 Clay 2011 3 12 Clay.2011

    ## split the catch by the different groups (creates a list of catch vectors) -ds <- split(d$catch,d$group) +ds <- split(d$catch,d$group) ## apply removal() to each catch vector (i.e., different group) -res <- lapply(ds,removal,just.ests=TRUE) -res <- data.frame(t(data.frame(res,check.names=FALSE))) +res <- lapply(ds,removal,just.ests=TRUE) +res <- data.frame(t(data.frame(res,check.names=FALSE))) ## get rownames from above and split into separate columns -nms <- t(data.frame(strsplit(rownames(res),"\\."))) -attr(nms,"dimnames") <- NULL -fnl <- data.frame(nms,res) +nms <- t(data.frame(strsplit(rownames(res),"\\."))) +attr(nms,"dimnames") <- NULL +fnl <- data.frame(nms,res) ## put names together with values -rownames(fnl) <- NULL -colnames(fnl)[1:2] <- c("Lake","Year") -fnl
    #> Lake Year No No.se No.LCI No.UCI p p.se p.LCI +rownames(fnl) <- NULL +colnames(fnl)[1:2] <- c("Lake","Year") +fnl +
    #> Lake Year No No.se No.LCI No.UCI p p.se p.LCI #> 1 Ash Tree 2010 130 26.108558 78.82817 181.1718 0.4482759 0.12120594 0.2107166 #> 2 Bark 2010 95 4.247687 86.67469 103.3253 0.5894040 0.06418406 0.4636055 #> 3 Clay 2010 130 17.446161 95.80615 164.1938 0.5233161 0.10171976 0.3239490 @@ -410,14 +439,16 @@

    Examp ### with the removals in several variables ("wide format") ## create a dummy data frame (just reshaped from above as ## an example; -5 to ignore the group variable from above) -d1 <- reshape(d[,-5],timevar="pass",idvar=c("lake","year"),direction="wide") +d1 <- reshape(d[,-5],timevar="pass",idvar=c("lake","year"),direction="wide") ## apply restore() to each row of only the catch data -res1 <- apply(d1[,3:5],MARGIN=1,FUN=removal,method="CarleStrub",just.ests=TRUE)

    #> Warning: 'NA's removed from 'catch' to continue.
    #> Warning: 'NA's removed from 'catch' to continue.
    #> Warning: 'NA's removed from 'catch' to continue.
    res1 <- data.frame(t(data.frame(res1,check.names=FALSE))) +res1 <- apply(d1[,3:5],MARGIN=1,FUN=removal,method="CarleStrub",just.ests=TRUE) +
    #> Warning: 'NA's removed from 'catch' to continue.
    #> Warning: 'NA's removed from 'catch' to continue.
    #> Warning: 'NA's removed from 'catch' to continue.
    res1 <- data.frame(t(data.frame(res1,check.names=FALSE))) ## add the grouping information to the results -fnl1 <- data.frame(d1[,1:2],res1) +fnl1 <- data.frame(d1[,1:2],res1) ## put names together with values -rownames(fnl1) <- NULL -fnl1
    #> lake year No No.se No.LCI No.UCI p p.se p.LCI +rownames(fnl1) <- NULL +fnl1 +
    #> lake year No No.se No.LCI No.UCI p p.se p.LCI #> 1 Ash Tree 2010 130 26.108558 78.82817 181.1718 0.4482759 0.12120594 0.2107166 #> 2 Ash Tree 2011 121 5.771511 109.68805 132.3120 0.5577889 0.06016508 0.4398676 #> 3 Bark 2010 95 4.247687 86.67469 103.3253 0.5894040 0.06418406 0.4636055 @@ -447,7 +478,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/residPlot-1.png b/docs/reference/residPlot-1.png index 27138322..b5b540be 100644 Binary files a/docs/reference/residPlot-1.png and b/docs/reference/residPlot-1.png differ diff --git a/docs/reference/residPlot-10.png b/docs/reference/residPlot-10.png index 13e7f077..c4a14b71 100644 Binary files a/docs/reference/residPlot-10.png and b/docs/reference/residPlot-10.png differ diff --git a/docs/reference/residPlot-11.png b/docs/reference/residPlot-11.png index 160c33b4..6549ebe6 100644 Binary files a/docs/reference/residPlot-11.png and b/docs/reference/residPlot-11.png differ diff --git a/docs/reference/residPlot-12.png b/docs/reference/residPlot-12.png index e3d18f5b..1cd4f97a 100644 Binary files a/docs/reference/residPlot-12.png and b/docs/reference/residPlot-12.png differ diff --git a/docs/reference/residPlot-13.png b/docs/reference/residPlot-13.png index 093200a4..ab2c1b11 100644 Binary files a/docs/reference/residPlot-13.png and b/docs/reference/residPlot-13.png differ diff --git a/docs/reference/residPlot-14.png b/docs/reference/residPlot-14.png index 6e04e37e..c59bb855 100644 Binary files a/docs/reference/residPlot-14.png and b/docs/reference/residPlot-14.png differ diff --git a/docs/reference/residPlot-15.png b/docs/reference/residPlot-15.png index 67850e74..f0b2aab9 100644 Binary files a/docs/reference/residPlot-15.png and b/docs/reference/residPlot-15.png differ diff --git a/docs/reference/residPlot-16.png b/docs/reference/residPlot-16.png index 5c123623..1630e6fa 100644 Binary files a/docs/reference/residPlot-16.png and b/docs/reference/residPlot-16.png differ diff --git a/docs/reference/residPlot-17.png b/docs/reference/residPlot-17.png index af6c0223..815a3ca6 100644 Binary files a/docs/reference/residPlot-17.png and b/docs/reference/residPlot-17.png differ diff --git a/docs/reference/residPlot-18.png b/docs/reference/residPlot-18.png index 38e71433..0e55a7b0 100644 Binary files a/docs/reference/residPlot-18.png and b/docs/reference/residPlot-18.png differ diff --git a/docs/reference/residPlot-19.png b/docs/reference/residPlot-19.png index ed07fdf0..4f9785af 100644 Binary files a/docs/reference/residPlot-19.png and b/docs/reference/residPlot-19.png differ diff --git a/docs/reference/residPlot-2.png b/docs/reference/residPlot-2.png index 80dd9cc8..fdacbe69 100644 Binary files a/docs/reference/residPlot-2.png and b/docs/reference/residPlot-2.png differ diff --git a/docs/reference/residPlot-20.png b/docs/reference/residPlot-20.png index 78d83ddd..29fc56a4 100644 Binary files a/docs/reference/residPlot-20.png and b/docs/reference/residPlot-20.png differ diff --git a/docs/reference/residPlot-21.png b/docs/reference/residPlot-21.png index 9ba19c2c..3885debe 100644 Binary files a/docs/reference/residPlot-21.png and b/docs/reference/residPlot-21.png differ diff --git a/docs/reference/residPlot-22.png b/docs/reference/residPlot-22.png index b709c00f..2f1636ea 100644 Binary files a/docs/reference/residPlot-22.png and b/docs/reference/residPlot-22.png differ diff --git a/docs/reference/residPlot-23.png b/docs/reference/residPlot-23.png index 31f28e8b..5cef573e 100644 Binary files a/docs/reference/residPlot-23.png and b/docs/reference/residPlot-23.png differ diff --git a/docs/reference/residPlot-24.png b/docs/reference/residPlot-24.png index 6ce7ad93..774a1d6d 100644 Binary files a/docs/reference/residPlot-24.png and b/docs/reference/residPlot-24.png differ diff --git a/docs/reference/residPlot-25.png b/docs/reference/residPlot-25.png index f473fda4..f628148f 100644 Binary files a/docs/reference/residPlot-25.png and b/docs/reference/residPlot-25.png differ diff --git a/docs/reference/residPlot-26.png b/docs/reference/residPlot-26.png index fa4eeb6f..bc4c60cd 100644 Binary files a/docs/reference/residPlot-26.png and b/docs/reference/residPlot-26.png differ diff --git a/docs/reference/residPlot-27.png b/docs/reference/residPlot-27.png index a49dd063..d9c07442 100644 Binary files a/docs/reference/residPlot-27.png and b/docs/reference/residPlot-27.png differ diff --git a/docs/reference/residPlot-28.png b/docs/reference/residPlot-28.png index 599899aa..37ee22d2 100644 Binary files a/docs/reference/residPlot-28.png and b/docs/reference/residPlot-28.png differ diff --git a/docs/reference/residPlot-29.png b/docs/reference/residPlot-29.png index f1841197..17f8bd24 100644 Binary files a/docs/reference/residPlot-29.png and b/docs/reference/residPlot-29.png differ diff --git a/docs/reference/residPlot-3.png b/docs/reference/residPlot-3.png index c76af488..3e584e05 100644 Binary files a/docs/reference/residPlot-3.png and b/docs/reference/residPlot-3.png differ diff --git a/docs/reference/residPlot-4.png b/docs/reference/residPlot-4.png index f9b1e00f..0d12bd19 100644 Binary files a/docs/reference/residPlot-4.png and b/docs/reference/residPlot-4.png differ diff --git a/docs/reference/residPlot-5.png b/docs/reference/residPlot-5.png index a3462b62..9333e285 100644 Binary files a/docs/reference/residPlot-5.png and b/docs/reference/residPlot-5.png differ diff --git a/docs/reference/residPlot-6.png b/docs/reference/residPlot-6.png index 2fb44db4..57b3fe7d 100644 Binary files a/docs/reference/residPlot-6.png and b/docs/reference/residPlot-6.png differ diff --git a/docs/reference/residPlot-7.png b/docs/reference/residPlot-7.png index 6ede0b99..87f3fa59 100644 Binary files a/docs/reference/residPlot-7.png and b/docs/reference/residPlot-7.png differ diff --git a/docs/reference/residPlot-8.png b/docs/reference/residPlot-8.png index 53467a61..111f238f 100644 Binary files a/docs/reference/residPlot-8.png and b/docs/reference/residPlot-8.png differ diff --git a/docs/reference/residPlot-9.png b/docs/reference/residPlot-9.png index 0d2a0633..396c303f 100644 Binary files a/docs/reference/residPlot-9.png and b/docs/reference/residPlot-9.png differ diff --git a/docs/reference/residPlot.html b/docs/reference/residPlot.html index 02bcf661..fe8d5c73 100644 --- a/docs/reference/residPlot.html +++ b/docs/reference/residPlot.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,129 +128,129 @@

    Construct a residual plot from lm or nls objects.

    Constructs a residual plot for lm or nls objects. Different symbols for different groups can be added to the plot if an indicator variable regression is used.

    -
    residPlot(object, ...)
    +    
    residPlot(object, ...)
     
     # S3 method for lm
    -residPlot(object, ...)
    +residPlot(object, ...)
     
     # S3 method for SLR
    -residPlot(
    -  object,
    -  xlab = "Fitted Values",
    -  ylab = "Residuals",
    -  main = "",
    -  pch = 16,
    -  col = "black",
    -  lty.ref = 3,
    -  lwd.ref = 1,
    -  col.ref = "black",
    -  resid.type = c("raw", "standardized", "studentized"),
    -  outlier.test = TRUE,
    -  alpha = 0.05,
    -  loess = FALSE,
    -  lty.loess = 2,
    -  lwd.loess = 1,
    -  col.loess = "black",
    -  trans.loess = 8,
    -  inclHist = TRUE,
    -  ...
    -)
    +residPlot(
    +  object,
    +  xlab = "Fitted Values",
    +  ylab = "Residuals",
    +  main = "",
    +  pch = 16,
    +  col = "black",
    +  lty.ref = 3,
    +  lwd.ref = 1,
    +  col.ref = "black",
    +  resid.type = c("raw", "standardized", "studentized"),
    +  outlier.test = TRUE,
    +  alpha = 0.05,
    +  loess = FALSE,
    +  lty.loess = 2,
    +  lwd.loess = 1,
    +  col.loess = "black",
    +  trans.loess = 8,
    +  inclHist = TRUE,
    +  ...
    +)
     
     # S3 method for POLY
    -residPlot(object, ...)
    +residPlot(object, ...)
     
     # S3 method for IVR
    -residPlot(object, legend = "topright", cex.leg = 1, box.lty.leg = 0, ...)
    +residPlot(object, legend = "topright", cex.leg = 1, box.lty.leg = 0, ...)
     
     # S3 method for ONEWAY
    -residPlot(
    -  object,
    -  xlab = "Fitted Values",
    -  ylab = "Residuals",
    -  main = "",
    -  pch = 16,
    -  col = "black",
    -  lty.ref = 3,
    -  lwd.ref = 1,
    -  col.ref = "black",
    -  resid.type = c("raw", "standardized", "studentized"),
    -  bp = TRUE,
    -  outlier.test = TRUE,
    -  alpha = 0.05,
    -  loess = FALSE,
    -  lty.loess = 2,
    -  lwd.loess = 1,
    -  col.loess = "black",
    -  trans.loess = 8,
    -  inclHist = TRUE,
    -  ...
    -)
    +residPlot(
    +  object,
    +  xlab = "Fitted Values",
    +  ylab = "Residuals",
    +  main = "",
    +  pch = 16,
    +  col = "black",
    +  lty.ref = 3,
    +  lwd.ref = 1,
    +  col.ref = "black",
    +  resid.type = c("raw", "standardized", "studentized"),
    +  bp = TRUE,
    +  outlier.test = TRUE,
    +  alpha = 0.05,
    +  loess = FALSE,
    +  lty.loess = 2,
    +  lwd.loess = 1,
    +  col.loess = "black",
    +  trans.loess = 8,
    +  inclHist = TRUE,
    +  ...
    +)
     
     # S3 method for TWOWAY
    -residPlot(
    -  object,
    -  xlab = "Fitted Values",
    -  ylab = "Residuals",
    -  main = "",
    -  pch = 16,
    -  col = "black",
    -  lty.ref = 3,
    -  lwd.ref = 1,
    -  col.ref = "black",
    -  resid.type = c("raw", "standardized", "studentized"),
    -  bp = TRUE,
    -  outlier.test = TRUE,
    -  alpha = 0.05,
    -  loess = FALSE,
    -  lty.loess = 2,
    -  lwd.loess = 1,
    -  col.loess = "black",
    -  trans.loess = 8,
    -  inclHist = TRUE,
    -  ...
    -)
    +residPlot(
    +  object,
    +  xlab = "Fitted Values",
    +  ylab = "Residuals",
    +  main = "",
    +  pch = 16,
    +  col = "black",
    +  lty.ref = 3,
    +  lwd.ref = 1,
    +  col.ref = "black",
    +  resid.type = c("raw", "standardized", "studentized"),
    +  bp = TRUE,
    +  outlier.test = TRUE,
    +  alpha = 0.05,
    +  loess = FALSE,
    +  lty.loess = 2,
    +  lwd.loess = 1,
    +  col.loess = "black",
    +  trans.loess = 8,
    +  inclHist = TRUE,
    +  ...
    +)
     
     # S3 method for nls
    -residPlot(
    -  object,
    -  xlab = "Fitted Values",
    -  ylab = "Residuals",
    -  main = "",
    -  pch = 16,
    -  col = "black",
    -  lty.ref = 3,
    -  lwd.ref = 1,
    -  col.ref = "black",
    -  resid.type = c("raw", "standardized", "studentized"),
    -  loess = FALSE,
    -  lty.loess = 2,
    -  lwd.loess = 1,
    -  col.loess = "black",
    -  trans.loess = 8,
    -  inclHist = TRUE,
    -  ...
    -)
    +residPlot(
    +  object,
    +  xlab = "Fitted Values",
    +  ylab = "Residuals",
    +  main = "",
    +  pch = 16,
    +  col = "black",
    +  lty.ref = 3,
    +  lwd.ref = 1,
    +  col.ref = "black",
    +  resid.type = c("raw", "standardized", "studentized"),
    +  loess = FALSE,
    +  lty.loess = 2,
    +  lwd.loess = 1,
    +  col.loess = "black",
    +  trans.loess = 8,
    +  inclHist = TRUE,
    +  ...
    +)
     
     # S3 method for nlme
    -residPlot(
    -  object,
    -  xlab = "Fitted Values",
    -  ylab = "Residuals",
    -  main = "",
    -  pch = 16,
    -  col = "black",
    -  lty.ref = 3,
    -  lwd.ref = 1,
    -  col.ref = "black",
    -  resid.type = c("raw", "standardized", "studentized"),
    -  loess = FALSE,
    -  lty.loess = 2,
    -  lwd.loess = 1,
    -  col.loess = "black",
    -  trans.loess = 8,
    -  inclHist = TRUE,
    -  ...
    -)
    +residPlot( + object, + xlab = "Fitted Values", + ylab = "Residuals", + main = "", + pch = 16, + col = "black", + lty.ref = 3, + lwd.ref = 1, + col.ref = "black", + resid.type = c("raw", "standardized", "studentized"), + loess = FALSE, + lty.loess = 2, + lwd.loess = 1, + col.loess = "black", + trans.loess = 8, + inclHist = TRUE, + ... +)

    Arguments

    @@ -365,67 +365,99 @@

    Note

    See also

    See residualPlots in car and nlsResiduals in nlstools) for similar functionality and fitPlot and outlierTest in car for related methods.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    # create year factor variable & reduce number of years for visual simplicity -Mirex$fyear <- factor(Mirex$year) -Mirex2 <- filterD(Mirex,fyear %in% c(1977,1992)) +Mirex$fyear <- factor(Mirex$year) +Mirex2 <- filterD(Mirex,fyear %in% c(1977,1992)) ## Indicator variable regression with two factors -lm1 <- lm(mirex~weight*fyear*species,data=Mirex2) +lm1 <- lm(mirex~weight*fyear*species,data=Mirex2) # defaults -residPlot(lm1)
    # remove the histogram -residPlot(lm1,inclHist=FALSE)
    # add the loess line -residPlot(lm1,loess=TRUE,inclHist=FALSE)
    # modify colors used -residPlot(lm1,col="rainbow",inclHist=FALSE)
    # use only one point type -- notice that all points are of same type -residPlot(lm1,pch=16,inclHist=FALSE)
    # use only one point and one color (might as well not use legend also) -residPlot(lm1,pch=16,col="black",legend=FALSE,inclHist=FALSE)
    # can accomplish same thing just by removing the legend -residPlot(lm1,legend=FALSE,inclHist=FALSE) +residPlot(lm1) +
    # remove the histogram +residPlot(lm1,inclHist=FALSE) +
    # add the loess line +residPlot(lm1,loess=TRUE,inclHist=FALSE) +
    # modify colors used +residPlot(lm1,col="rainbow",inclHist=FALSE) +
    # use only one point type -- notice that all points are of same type +residPlot(lm1,pch=16,inclHist=FALSE) +
    # use only one point and one color (might as well not use legend also) +residPlot(lm1,pch=16,col="black",legend=FALSE,inclHist=FALSE) +
    # can accomplish same thing just by removing the legend +residPlot(lm1,legend=FALSE,inclHist=FALSE) # modify the reference line -residPlot(lm1,col.ref="blue",lwd.ref=5,inclHist=FALSE)
    # include model in the title -residPlot(lm1,main="MODEL")
    # use Studentized residuals -residPlot(lm1,resid.type="studentized",inclHist=FALSE)
    # use Standardized residuals -residPlot(lm1,resid.type="standardized",inclHist=FALSE)
    +residPlot(lm1,col.ref="blue",lwd.ref=5,inclHist=FALSE) +
    # include model in the title +residPlot(lm1,main="MODEL") +
    # use Studentized residuals +residPlot(lm1,resid.type="studentized",inclHist=FALSE) +
    # use Standardized residuals +residPlot(lm1,resid.type="standardized",inclHist=FALSE) +
    ## Indicator variable regression with same two factors but in different order ## (notice use of colors and symbols) -lm1a <- lm(mirex~weight*species*fyear,data=Mirex2) -residPlot(lm1a)
    +lm1a <- lm(mirex~weight*species*fyear,data=Mirex2) +residPlot(lm1a) +
    ## Indicator variable regression with only one factor -lm2 <- lm(mirex~weight*fyear,data=Mirex) -residPlot(lm2)
    residPlot(lm2,inclHist=FALSE)
    residPlot(lm2,inclHist=FALSE,pch=19)
    residPlot(lm2,inclHist=FALSE,pch=19,col="black")
    residPlot(lm2,inclHist=FALSE,legend=FALSE)
    residPlot(lm2,inclHist=FALSE,pch=2,col="red",legend=FALSE)
    +lm2 <- lm(mirex~weight*fyear,data=Mirex) +residPlot(lm2) +
    residPlot(lm2,inclHist=FALSE) +
    residPlot(lm2,inclHist=FALSE,pch=19) +
    residPlot(lm2,inclHist=FALSE,pch=19,col="black") +
    residPlot(lm2,inclHist=FALSE,legend=FALSE) +
    residPlot(lm2,inclHist=FALSE,pch=2,col="red",legend=FALSE) +
    ## Indicator variable regression (assuming same slope) -lm3 <- lm(mirex~weight+fyear,data=Mirex) -residPlot(lm3)
    +lm3 <- lm(mirex~weight+fyear,data=Mirex) +residPlot(lm3) +
    ## Simple linear regression -lm4 <- lm(mirex~weight,data=Mirex) -residPlot(lm4)
    +lm4 <- lm(mirex~weight,data=Mirex) +residPlot(lm4) +
    ## One-way ANOVA -lm5 <- lm(mirex~fyear,data=Mirex) +lm5 <- lm(mirex~fyear,data=Mirex) # default (uses boxplots) -residPlot(lm5)
    # use points rather than boxplot -residPlot(lm5,bp=FALSE)
    +residPlot(lm5) +
    # use points rather than boxplot +residPlot(lm5,bp=FALSE) +
    ## Two-Way ANOVA -lm6 <- lm(mirex~species*fyear,data=Mirex) +lm6 <- lm(mirex~species*fyear,data=Mirex) # default (uses boxplots) -residPlot(lm6)
    # No boxplots -residPlot(lm6,bp=FALSE)
    +residPlot(lm6) +
    # No boxplots +residPlot(lm6,bp=FALSE) +
    ## Examples showing outlier detection -x <- c(runif(100)) -y <- c(7,runif(99)) -lma <- lm(y~x) -residPlot(lma)
    # with studentized residuals -residPlot(lma,resid.type="studentized")
    # multiple outliers -y <- c(7,runif(98),-5) -lmb <- lm(y~x) -residPlot(lmb)
    # check that NAs are handled properly ... label should be 100 -y <- c(NA,NA,runif(97),7) -lmc <- lm(y~x) -residPlot(lmc)
    +x <- c(runif(100)) +y <- c(7,runif(99)) +lma <- lm(y~x) +residPlot(lma) +
    # with studentized residuals +residPlot(lma,resid.type="studentized") +
    # multiple outliers +y <- c(7,runif(98),-5) +lmb <- lm(y~x) +residPlot(lmb) +
    # check that NAs are handled properly ... label should be 100 +y <- c(NA,NA,runif(97),7) +lmc <- lm(y~x) +residPlot(lmc) +
    ## Nonlinear regression # from first example in nls() -DNase1 <- subset(DNase,Run==1) -fm1DNase1 <- nls(density~SSlogis(log(conc),Asym,xmid,scal),DNase1) -residPlot(fm1DNase1)
    residPlot(fm1DNase1,resid.type="standardized")
    +DNase1 <- subset(DNase,Run==1) +fm1DNase1 <- nls(density~SSlogis(log(conc),Asym,xmid,scal),DNase1) +residPlot(fm1DNase1) +
    residPlot(fm1DNase1,resid.type="standardized") +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/se.html b/docs/reference/se.html index 3a982da2..4fa06082 100644 --- a/docs/reference/se.html +++ b/docs/reference/se.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Computes standard error of the mean.

    Computes the standard error of the mean (i.e., standard deviation divided by the square root of the sample size).

    -
    se(x, na.rm = TRUE)
    +
    se(x, na.rm = TRUE)

    Arguments

    @@ -149,15 +149,24 @@

    Value

    See also

    See se in sciplot for similar functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    x <- 1:20 -sd(x)/sqrt(length(x))
    #> [1] 1.322876
    se(x)
    #> [1] 1.322876
    +
    x <- 1:20 +sd(x)/sqrt(length(x)) +
    #> [1] 1.322876
    se(x) +
    #> [1] 1.322876
    # all return NA if missing values are not removed -x2 <- c(x,NA) -sd(x2)/sqrt(length(x2))
    #> [1] NA
    +x2 <- c(x,NA) +sd(x2)/sqrt(length(x2)) +
    #> [1] NA
    # Better if missing values are removed -se(x2,na.rm=FALSE)
    #> [1] NA
    sd(x2,na.rm=TRUE)/sqrt(length(x2[complete.cases(x2)]))
    #> [1] 1.322876
    se(x2)
    #> [1] 1.322876
    +se(x2,na.rm=FALSE) +
    #> [1] NA
    sd(x2,na.rm=TRUE)/sqrt(length(x2[complete.cases(x2)])) +
    #> [1] 1.322876
    se(x2) +
    #> [1] 1.322876
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/srStarts-1.png b/docs/reference/srStarts-1.png index 769a7e55..9c2388d1 100644 Binary files a/docs/reference/srStarts-1.png and b/docs/reference/srStarts-1.png differ diff --git a/docs/reference/srStarts-2.png b/docs/reference/srStarts-2.png index 2fab0adf..c6aa2996 100644 Binary files a/docs/reference/srStarts-2.png and b/docs/reference/srStarts-2.png differ diff --git a/docs/reference/srStarts-3.png b/docs/reference/srStarts-3.png index 15e93ce6..ae432aac 100644 Binary files a/docs/reference/srStarts-3.png and b/docs/reference/srStarts-3.png differ diff --git a/docs/reference/srStarts-4.png b/docs/reference/srStarts-4.png index 6abb1471..29835683 100644 Binary files a/docs/reference/srStarts-4.png and b/docs/reference/srStarts-4.png differ diff --git a/docs/reference/srStarts-5.png b/docs/reference/srStarts-5.png index 494912cb..610bf72a 100644 Binary files a/docs/reference/srStarts-5.png and b/docs/reference/srStarts-5.png differ diff --git a/docs/reference/srStarts.html b/docs/reference/srStarts.html index ca57f3a0..901043f1 100644 --- a/docs/reference/srStarts.html +++ b/docs/reference/srStarts.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,21 +128,21 @@

    Finds reasonable starting values for parameters in specific parameterization

    Finds reasonable starting values for parameters in specific parameterizations of the “Beverton-Holt”, “Ricker”, “Shepherd”, or “Saila-Lorda” stock-recruitment models. Use srFunShow() to see the equations of each model.

    -
    srStarts(
    -  formula,
    -  data = NULL,
    -  type = c("BevertonHolt", "Ricker", "Shepherd", "SailaLorda", "independence"),
    -  param = 1,
    -  fixed = NULL,
    -  plot = FALSE,
    -  col.mdl = "gray70",
    -  lwd.mdl = 3,
    -  lty.mdl = 1,
    -  cex.main = 0.9,
    -  col.main = "red",
    -  dynamicPlot = FALSE,
    -  ...
    -)
    +
    srStarts(
    +  formula,
    +  data = NULL,
    +  type = c("BevertonHolt", "Ricker", "Shepherd", "SailaLorda", "independence"),
    +  param = 1,
    +  fixed = NULL,
    +  plot = FALSE,
    +  col.mdl = "gray70",
    +  lwd.mdl = 3,
    +  lty.mdl = 1,
    +  cex.main = 0.9,
    +  col.main = "red",
    +  dynamicPlot = FALSE,
    +  ...
    +)

    Arguments

    @@ -216,7 +216,7 @@

    <

    13-Recruitment.

    References

    -

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

    +

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

    Beverton, R.J.H. and S.J. Holt. 1957. On the dynamics of exploited fish populations, Fisheries Investigations (Series 2), volume 19. United Kingdom Ministry of Agriculture and Fisheries, 533 pp.

    Iles, T.C. 1994. A review of stock-recruitment relationships with reference to flatfish populations. Netherlands Journal of Sea Research 32:399-420.

    Quinn II, T.J. and R.B. Deriso. 1999. Quantitative Fish Dynamics. Oxford University Press.

    @@ -226,45 +226,56 @@

    R

    See also

    See srFunShow and srFuns for related functionality. See nlsTracePlot for help troubleshooting nonlinear models that don't converge.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Simple Examples -srStarts(recruits~stock,data=CodNorwegian)
    #> $a +srStarts(recruits~stock,data=CodNorwegian) +
    #> $a #> [1] 6.040326 #> #> $b #> [1] 0.08789475 -#>
    srStarts(recruits~stock,data=CodNorwegian,param=2)
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,param=2) +
    #> $a #> [1] 6.040326 #> #> $Rp #> [1] 68.72227 -#>
    srStarts(recruits~stock,data=CodNorwegian,param=3)
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,param=3) +
    #> $a #> [1] 0.165554 #> #> $b #> [1] 0.01455132 -#>
    srStarts(recruits~stock,data=CodNorwegian,param=4)
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,param=4) +
    #> $a #> [1] 0.165554 #> #> $Rp #> [1] 68.72227 -#>
    srStarts(recruits~stock,data=CodNorwegian,type="Ricker")
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,type="Ricker") +
    #> $a #> [1] 5.919256 #> #> $b #> [1] 0.01836117 -#>
    srStarts(recruits~stock,data=CodNorwegian,type="Ricker",param=2)
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,type="Ricker",param=2) +
    #> $a #> [1] 1.778211 #> #> $b #> [1] 0.01836117 -#>
    srStarts(recruits~stock,data=CodNorwegian,type="Ricker",param=3)
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,type="Ricker",param=3) +
    #> $a #> [1] 5.919256 #> #> $Rp #> [1] 118.5966 -#>
    srStarts(recruits~stock,data=CodNorwegian,type="Shepherd")
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,type="Shepherd") +
    #> $a #> [1] 6.040326 #> #> $b @@ -272,7 +283,8 @@

    Examp #> #> $c #> [1] 1 -#>

    srStarts(recruits~stock,data=CodNorwegian,type="SailaLorda")
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,type="SailaLorda") +
    #> $a #> [1] 5.919256 #> #> $b @@ -280,21 +292,25 @@

    Examp #> #> $c #> [1] 1 -#>

    srStarts(recruits~stock,data=CodNorwegian,type="independence")
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,type="independence") +
    #> $a #> [1] 0.630291 #>
    ## Simple Examples with a Plot -srStarts(recruits~stock,data=CodNorwegian,type="Ricker",plot=TRUE)
    #> $a +srStarts(recruits~stock,data=CodNorwegian,type="Ricker",plot=TRUE) +
    #> $a #> [1] 5.919256 #> #> $b #> [1] 0.01836117 -#>
    srStarts(recruits~stock,data=CodNorwegian,type="BevertonHolt",plot=TRUE)
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,type="BevertonHolt",plot=TRUE) +
    #> $a #> [1] 6.040326 #> #> $b #> [1] 0.08789475 -#>
    srStarts(recruits~stock,data=CodNorwegian,type="Shepherd",plot=TRUE)
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,type="Shepherd",plot=TRUE) +
    #> $a #> [1] 6.040326 #> #> $b @@ -302,7 +318,8 @@

    Examp #> #> $c #> [1] 1 -#>

    srStarts(recruits~stock,data=CodNorwegian,type="SailaLorda",plot=TRUE)
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,type="SailaLorda",plot=TRUE) +
    #> $a #> [1] 5.919256 #> #> $b @@ -310,10 +327,11 @@

    Examp #> #> $c #> [1] 1 -#>

    srStarts(recruits~stock,data=CodNorwegian,type="independence",plot=TRUE)
    #> $a +#>
    srStarts(recruits~stock,data=CodNorwegian,type="independence",plot=TRUE) +
    #> $a #> [1] 0.630291 #>
    -## See examples in srFuns() for use of srStarts() when fitting stock-recruit models +## See examples in srFuns() for use of srStarts() when fitting stock-recruit models
    @@ -331,7 +349,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/stockRecruitment-1.png b/docs/reference/stockRecruitment-1.png index 5ae3da2e..cc941742 100644 Binary files a/docs/reference/stockRecruitment-1.png and b/docs/reference/stockRecruitment-1.png differ diff --git a/docs/reference/stockRecruitment-2.png b/docs/reference/stockRecruitment-2.png index 86a1499d..6653b1ac 100644 Binary files a/docs/reference/stockRecruitment-2.png and b/docs/reference/stockRecruitment-2.png differ diff --git a/docs/reference/stockRecruitment-3.png b/docs/reference/stockRecruitment-3.png index a8b454e0..464f0f86 100644 Binary files a/docs/reference/stockRecruitment-3.png and b/docs/reference/stockRecruitment-3.png differ diff --git a/docs/reference/stockRecruitment-4.png b/docs/reference/stockRecruitment-4.png index 4f6e8f31..87d6c928 100644 Binary files a/docs/reference/stockRecruitment-4.png and b/docs/reference/stockRecruitment-4.png differ diff --git a/docs/reference/stockRecruitment-5.png b/docs/reference/stockRecruitment-5.png index 90bb5374..cf3d55e1 100644 Binary files a/docs/reference/stockRecruitment-5.png and b/docs/reference/stockRecruitment-5.png differ diff --git a/docs/reference/stockRecruitment.html b/docs/reference/stockRecruitment.html index 99967f63..2798062f 100644 --- a/docs/reference/stockRecruitment.html +++ b/docs/reference/stockRecruitment.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,19 +128,19 @@

    Creates a function for a specific parameterization of a common stock-recruit

    Creates a function for a specific parameterization of a “Beverton-Holt”, “Ricker”, “Shepherd”, or “Saila-Lorda” stock-recruitment function. Use srFunShow() to see the equations of each function.

    -
    srFuns(
    -  type = c("BevertonHolt", "Ricker", "Shepherd", "SailaLorda", "independence"),
    -  param = 1,
    -  simple = FALSE,
    -  msg = FALSE
    -)
    +    
    srFuns(
    +  type = c("BevertonHolt", "Ricker", "Shepherd", "SailaLorda", "independence"),
    +  param = 1,
    +  simple = FALSE,
    +  msg = FALSE
    +)
     
    -srFunShow(
    -  type = c("BevertonHolt", "Ricker", "Shepherd", "SailaLorda"),
    -  param = 1,
    -  plot = FALSE,
    -  ...
    -)
    +srFunShow( + type = c("BevertonHolt", "Ricker", "Shepherd", "SailaLorda"), + param = 1, + plot = FALSE, + ... +)

    Arguments

    @@ -180,7 +180,7 @@

    <

    13-Recruitment.

    References

    -

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

    +

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

    Beverton, R.J.H. and S.J. Holt. 1957. On the dynamics of exploited fish populations, Fisheries Investigations (Series 2), volume 19. United Kingdom Ministry of Agriculture and Fisheries, 533 pp.

    Iles, T.C. 1994. A review of stock-recruitment relationships with reference to flatfish populations. Netherlands Journal of Sea Research 32:399-420.

    Quinn II, T.J. and R.B. Deriso. 1999. Quantitative Fish Dynamics. Oxford University Press.

    @@ -190,58 +190,93 @@

    R

    See also

    See srStarts for related functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com, thanks to Gabor Grothendieck for a hint about using get().

    Examples

    ## See the formulae ## Simple Examples # show what a message looks like with the function definition -srFuns("Ricker",msg=TRUE)
    #> You have chosen the first parameterization of the 'Ricker' S-R function. +srFuns("Ricker",msg=TRUE) +
    #> You have chosen the first parameterization of the 'Ricker' S-R function. #> #> E[R|S] = a*S*exp(-b*S) #> #> where a = the density-independent slope near S=0. -#> b = density-dependent parameter.
    #> function(S,a,b=NULL) { -#> if (length(a)>1) { b <- a[[2]]; a <- a[[1]] } -#> a*S*exp(-b*S) -#> } -#> <bytecode: 0x000000001af5be00> -#> <environment: 0x0000000009c626f0>
    +#> b = density-dependent parameter.
    #> function (S, a, b = NULL) +#> { +#> if (length(a) > 1) { +#> b <- a[[2]] +#> a <- a[[1]] +#> } +#> a * S * exp(-b * S) +#> } +#> <bytecode: 0x000000001b8c26f8> +#> <environment: 0x0000000020aacf58>
    # create some dummy stock data -stock <- seq(0.01,1000,length.out=199) +stock <- seq(0.01,1000,length.out=199) # Beverton-Holt #1 parameterization -( bh1 <- srFuns() )
    #> function(S,a,b=NULL) { -#> if (length(a)>1) { b <- a[[2]]; a <- a[[1]] } -#> a*S/(1+b*S) -#> } -#> <bytecode: 0x000000001c91f1b8> -#> <environment: 0x00000000083d0e68>
    plot(bh1(stock,a=0.5,b=0.01)~stock,type="l",lwd=2,ylab="Recruits",xlab="Spawners",ylim=c(0,50))
    +( bh1 <- srFuns() ) +
    #> function (S, a, b = NULL) +#> { +#> if (length(a) > 1) { +#> b <- a[[2]] +#> a <- a[[1]] +#> } +#> a * S/(1 + b * S) +#> } +#> <bytecode: 0x000000001b8c7fc0> +#> <environment: 0x000000002902cd00>
    plot(bh1(stock,a=0.5,b=0.01)~stock,type="l",lwd=2,ylab="Recruits",xlab="Spawners",ylim=c(0,50)) +
    # Ricker #1 parameterization -( r1 <- srFuns("Ricker") )
    #> function(S,a,b=NULL) { -#> if (length(a)>1) { b <- a[[2]]; a <- a[[1]] } -#> a*S*exp(-b*S) -#> } -#> <bytecode: 0x000000001af5be00> -#> <environment: 0x00000000190bd138>
    lines(r1(stock,a=0.5,b=0.005)~stock,lwd=2,col="red")
    +( r1 <- srFuns("Ricker") ) +
    #> function (S, a, b = NULL) +#> { +#> if (length(a) > 1) { +#> b <- a[[2]] +#> a <- a[[1]] +#> } +#> a * S * exp(-b * S) +#> } +#> <bytecode: 0x000000001b8c26f8> +#> <environment: 0x0000000028ff9780>
    lines(r1(stock,a=0.5,b=0.005)~stock,lwd=2,col="red") +
    # Shephered parameterization -( s1 <- srFuns("Shepherd") )
    #> function(S,a,b=NULL,c=NULL) { -#> if (length(a)>1) { c <- a[[3]]; b <- a[[2]]; a <- a[[1]] } -#> a*S/(1+(b*S)^c) -#> } -#> <bytecode: 0x000000001bd7a348> -#> <environment: 0x000000001aa062b8>
    lines(s1(stock,a=0.5,b=0.005,c=2.5)~stock,lwd=2,col="blue")
    +( s1 <- srFuns("Shepherd") ) +
    #> function (S, a, b = NULL, c = NULL) +#> { +#> if (length(a) > 1) { +#> c <- a[[3]] +#> b <- a[[2]] +#> a <- a[[1]] +#> } +#> a * S/(1 + (b * S)^c) +#> } +#> <bytecode: 0x000000001b8bf680> +#> <environment: 0x0000000028e5e868>
    lines(s1(stock,a=0.5,b=0.005,c=2.5)~stock,lwd=2,col="blue") +
    # Saila-Lorda parameterization -( sl1 <- srFuns("SailaLorda") )
    #> function(S,a,b=NULL,c=NULL) { -#> if (length(a)>1) { c <- a[[3]]; b <- a[[2]]; a <- a[[1]] } -#> a*(S^c)*exp(-b*S) -#> } -#> <bytecode: 0x000000001bbc01d0> -#> <environment: 0x000000001a947da0>
    lines(sl1(stock,a=0.5,b=0.005,c=1.05)~stock,lwd=2,col="salmon")
    +( sl1 <- srFuns("SailaLorda") ) +
    #> function (S, a, b = NULL, c = NULL) +#> { +#> if (length(a) > 1) { +#> c <- a[[3]] +#> b <- a[[2]] +#> a <- a[[1]] +#> } +#> a * (S^c) * exp(-b * S) +#> } +#> <bytecode: 0x000000001b8bcce0> +#> <environment: 0x0000000020aa15e8>
    lines(sl1(stock,a=0.5,b=0.005,c=1.05)~stock,lwd=2,col="salmon") +
    ## Examples of fitting stock-recruitment functions # Fitting the Beverton-Holt #1 parameterization with multiplicative errors -bh1s <- srStarts(recruits~stock,data=CodNorwegian) -fit1 <- nls(log(recruits)~log(bh1(stock,a,b)),data=CodNorwegian,start=bh1s) -summary(fit1,correlation=TRUE)
    #> +bh1s <- srStarts(recruits~stock,data=CodNorwegian) +fit1 <- nls(log(recruits)~log(bh1(stock,a,b)),data=CodNorwegian,start=bh1s) +summary(fit1,correlation=TRUE) +
    #> #> Formula: log(recruits) ~ log(bh1(stock, a, b)) #> #> Parameters: @@ -257,12 +292,15 @@

    Examp #> #> Number of iterations to convergence: 6 #> Achieved convergence tolerance: 7.103e-06 -#>

    plot(recruits~stock,data=CodNorwegian,pch=19,xlim=c(0,200))
    curve(bh1(x,a=coef(fit1)[1],b=coef(fit1)[2]),from=0,to=200,col="red",lwd=3,add=TRUE)
    +#>
    plot(recruits~stock,data=CodNorwegian,pch=19,xlim=c(0,200)) +
    curve(bh1(x,a=coef(fit1)[1],b=coef(fit1)[2]),from=0,to=200,col="red",lwd=3,add=TRUE) +
    # Fitting the Ricker #3 parameterization with multiplicative errors -r3 <- srFuns("Ricker",param=3) -r3s <- srStarts(recruits~stock,data=CodNorwegian,type="Ricker",param=3) -fit2 <- nls(log(recruits)~log(r3(stock,a,Rp)),data=CodNorwegian,start=r3s) -summary(fit2,correlation=TRUE)
    #> +r3 <- srFuns("Ricker",param=3) +r3s <- srStarts(recruits~stock,data=CodNorwegian,type="Ricker",param=3) +fit2 <- nls(log(recruits)~log(r3(stock,a,Rp)),data=CodNorwegian,start=r3s) +summary(fit2,correlation=TRUE) +
    #> #> Formula: log(recruits) ~ log(r3(stock, a, Rp)) #> #> Parameters: @@ -280,19 +318,34 @@

    Examp #> #> Number of iterations to convergence: 0 #> Achieved convergence tolerance: 1.391e-08 -#>

    curve(r3(x,a=coef(fit2)[1],Rp=coef(fit2)[2]),from=0,to=200,col="blue",lwd=3,add=TRUE)
    +#>
    curve(r3(x,a=coef(fit2)[1],Rp=coef(fit2)[2]),from=0,to=200,col="blue",lwd=3,add=TRUE) +
    ############################################################################# ## Create expressions of the functions ############################################################################# # Simple example -srFunShow()
    #> expression(R == frac(aS, 1 + bS))
    srFunShow(plot=TRUE)
    #> expression(R == frac(aS, 1 + bS))
    srFunShow("BevertonHolt",1,plot=TRUE)
    #> expression(R == frac(aS, 1 + bS))
    +srFunShow() +
    #> expression(R == frac(aS, 1 + bS))
    srFunShow(plot=TRUE) +
    #> expression(R == frac(aS, 1 + bS))
    srFunShow("BevertonHolt",1,plot=TRUE) +
    #> expression(R == frac(aS, 1 + bS))
    # Get and save the expression -( tmp <- srFunShow("BevertonHolt",1) )
    #> expression(R == frac(aS, 1 + bS))
    # Use expression as title on a plot -plot(bh1(stock,a=0.5,b=0.01)~stock,type="l",ylim=c(0,50), - ylab="Recruits",xlab="Spawners",main=tmp)
    # Put expression in the main plot -text(800,10,tmp)
    # Put multiple expressions on a plot -op <- par(mar=c(0.1,0.1,0.1,0.1)) -plot(0,type="n",xlab="",ylab="",xlim=c(0,1),ylim=c(0,3),xaxt="n",yaxt="n")
    text(0,2.5,"Beverton-Holt #1:",pos=4)
    text(0.5,2.5,srFunShow("BevertonHolt",1))
    text(0,1.5,"Ricker #2:",pos=4)
    text(0.5,1.5,srFunShow("Ricker",2))
    text(0,0.5,"Shepherd:",pos=4)
    text(0.5,0.5,srFunShow("Shepherd"))
    par(op)
    +(tmp<-srFunShow("BevertonHolt",1)) +
    #> expression(R == frac(aS, 1 + bS))
    # Use expression as title on a plot +plot(bh1(stock,a=0.5,b=0.01)~stock,type="l",ylim=c(0,50), + ylab="Recruits",xlab="Spawners",main=tmp) +
    # Put expression in the main plot +text(800,10,tmp) +
    # Put multiple expressions on a plot +op <- par(mar=c(0.1,0.1,0.1,0.1)) +plot(0,type="n",xlab="",ylab="",xlim=c(0,1),ylim=c(0,3),xaxt="n",yaxt="n") +
    text(0,2.5,"Beverton-Holt #1:",pos=4) +
    text(0.5,2.5,srFunShow("BevertonHolt",1)) +
    text(0,1.5,"Ricker #2:",pos=4) +
    text(0.5,1.5,srFunShow("Ricker",2)) +
    text(0,0.5,"Shepherd:",pos=4) +
    text(0.5,0.5,srFunShow("Shepherd")) +
    par(op) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/sumTable.html b/docs/reference/sumTable.html index e97aaec5..16918f32 100644 --- a/docs/reference/sumTable.html +++ b/docs/reference/sumTable.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,10 +128,10 @@

    Creates a one- or two-way table of summary statistics.

    Creates a one- or two-way table of summary statistics for a quantitative variable.

    -
    sumTable(formula, ...)
    +    
    sumTable(formula, ...)
     
     # S3 method for formula
    -sumTable(formula, data = NULL, FUN = mean, digits = getOption("digits"), ...)
    +sumTable(formula, data = NULL, FUN = mean, digits = getOption("digits"), ...)

    Arguments

    @@ -168,48 +168,60 @@

    Details

    See also

    See tapply for a more general implementation. See Summarize for a similar computation when only one factor variable is given.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## The same examples as in the old aggregate.table in gdata package ## but data in data.frame to illustrate formula notation -d <- data.frame(g1=sample(letters[1:5], 1000, replace=TRUE), - g2=sample(LETTERS[1:3], 1000, replace=TRUE), - dat=rnorm(1000)) +d <- data.frame(g1=sample(letters[1:5], 1000, replace=TRUE), + g2=sample(LETTERS[1:3], 1000, replace=TRUE), + dat=rnorm(1000)) -sumTable(dat~g1*g2,data=d,FUN=length) # get sample size
    #> Warning: First RHS variable was converted to a factor.
    #> Warning: Second RHS variable was converted to a factor.
    #> A B C +sumTable(dat~g1*g2,data=d,FUN=length) # get sample size +
    #> Warning: First RHS variable was converted to a factor.
    #> Warning: Second RHS variable was converted to a factor.
    #> A B C #> a 67 68 75 #> b 60 65 66 #> c 55 78 75 #> d 72 67 54 -#> e 62 75 61
    sumTable(dat~g1*g2,data=d,FUN=validn) # get sample size (better way)
    #> Warning: First RHS variable was converted to a factor.
    #> Warning: Second RHS variable was converted to a factor.
    #> A B C +#> e 62 75 61
    sumTable(dat~g1*g2,data=d,FUN=validn) # get sample size (better way) +
    #> Warning: First RHS variable was converted to a factor.
    #> Warning: Second RHS variable was converted to a factor.
    #> A B C #> a 67 68 75 #> b 60 65 66 #> c 55 78 75 #> d 72 67 54 -#> e 62 75 61
    sumTable(dat~g1*g2,data=d,FUN=mean) # get mean
    #> Warning: First RHS variable was converted to a factor.
    #> Warning: Second RHS variable was converted to a factor.
    #> A B C +#> e 62 75 61
    sumTable(dat~g1*g2,data=d,FUN=mean) # get mean +
    #> Warning: First RHS variable was converted to a factor.
    #> Warning: Second RHS variable was converted to a factor.
    #> A B C #> a 0.0357763 -0.0781936 -0.1657168 #> b 0.0686392 0.0490816 -0.0135043 #> c -0.1097829 -0.0486164 -0.0429865 #> d 0.0027510 0.0227142 0.0080689 -#> e 0.0404221 -0.0496906 0.1481047
    sumTable(dat~g1*g2,data=d,FUN=sd) # get sd
    #> Warning: First RHS variable was converted to a factor.
    #> Warning: Second RHS variable was converted to a factor.
    #> A B C +#> e 0.0404221 -0.0496906 0.1481047
    sumTable(dat~g1*g2,data=d,FUN=sd) # get sd +
    #> Warning: First RHS variable was converted to a factor.
    #> Warning: Second RHS variable was converted to a factor.
    #> A B C #> a 0.9758894 0.9684629 0.9222737 #> b 1.0105781 1.0553478 1.1011553 #> c 0.9325123 0.8604071 0.9594141 #> d 1.0962841 1.0765499 1.1485383 -#> e 1.0095996 1.0989148 0.9989456
    sumTable(dat~g1*g2,data=d,FUN=sd,digits=1) # show digits= argument
    #> Warning: First RHS variable was converted to a factor.
    #> Warning: Second RHS variable was converted to a factor.
    #> A B C +#> e 1.0095996 1.0989148 0.9989456
    sumTable(dat~g1*g2,data=d,FUN=sd,digits=1) # show digits= argument +
    #> Warning: First RHS variable was converted to a factor.
    #> Warning: Second RHS variable was converted to a factor.
    #> A B C #> a 1.0 1.0 0.9 #> b 1.0 1.1 1.1 #> c 0.9 0.9 1.0 #> d 1.1 1.1 1.1 #> e 1.0 1.1 1.0
    ## Also demonstrate use in the 1-way example -- but see Summarize() -sumTable(dat~g1,data=d,FUN=validn)
    #> Warning: RHS variable was converted to a factor.
    #> a b c d e -#> 210 191 208 193 198
    sumTable(dat~g1,data=d,FUN=mean)
    #> Warning: RHS variable was converted to a factor.
    #> a b c d e +sumTable(dat~g1,data=d,FUN=validn) +
    #> Warning: RHS variable was converted to a factor.
    #> a b c d e +#> 210 191 208 193 198
    sumTable(dat~g1,data=d,FUN=mean) +
    #> Warning: RHS variable was converted to a factor.
    #> a b c d e #> -0.0730901 0.0335988 -0.0627602 0.0111691 0.0394634
    ## Example with a missing value (compare to above) -d$dat[1] <- NA -sumTable(dat~g1,data=d,FUN=validn) # note use of validn
    #> Warning: RHS variable was converted to a factor.
    #> a b c d e -#> 210 191 207 193 198
    sumTable(dat~g1,data=d,FUN=mean,na.rm=TRUE)
    #> Warning: RHS variable was converted to a factor.
    #> a b c d e +d$dat[1] <- NA +sumTable(dat~g1,data=d,FUN=validn) # note use of validn +
    #> Warning: RHS variable was converted to a factor.
    #> a b c d e +#> 210 191 207 193 198
    sumTable(dat~g1,data=d,FUN=mean,na.rm=TRUE) +
    #> Warning: RHS variable was converted to a factor.
    #> a b c d e #> -0.0730901 0.0335988 -0.0667610 0.0111691 0.0394634
    @@ -227,7 +239,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/tictactoe-1.png b/docs/reference/tictactoe-1.png index 5bda9104..f0c479a0 100644 Binary files a/docs/reference/tictactoe-1.png and b/docs/reference/tictactoe-1.png differ diff --git a/docs/reference/tictactoe-2.png b/docs/reference/tictactoe-2.png index f9d1a688..3a60146a 100644 Binary files a/docs/reference/tictactoe-2.png and b/docs/reference/tictactoe-2.png differ diff --git a/docs/reference/tictactoe.html b/docs/reference/tictactoe.html index c98d7685..2abb3720 100644 --- a/docs/reference/tictactoe.html +++ b/docs/reference/tictactoe.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,17 +128,17 @@

    Construct a base tic-tac-toe plot for presenting predator-prey PSD values.Construct a base tic-tac-toe plot for presenting predator-prey PSD values. Predator-prey PSD values are added with plotCI from plotrix.

    -
    tictactoe(
    -  predobj = c(30, 70),
    -  preyobj = c(30, 70),
    -  predlab = "Predator PSD",
    -  preylab = "Prey PSD",
    -  obj.col = "black",
    -  obj.trans = 0.2,
    -  bnd.col = "black",
    -  bnd.lwd = 1,
    -  bnd.lty = 2
    -)
    +
    tictactoe(
    +  predobj = c(30, 70),
    +  preyobj = c(30, 70),
    +  predlab = "Predator PSD",
    +  preylab = "Prey PSD",
    +  obj.col = "black",
    +  obj.trans = 0.2,
    +  bnd.col = "black",
    +  bnd.lwd = 1,
    +  bnd.lty = 2
    +)

    Arguments

    @@ -192,42 +192,55 @@

    <

    6-Size Structure.

    References

    -

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

    +

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

    See also

    See psdVal and psdCalc for related functionality.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Create hypothetical data for plotting one point .. similar to what might come from psdCalc() -prey <- c(45.4,30.2,56.8) -pred <- c(24.5,10.2,36.7) -names(prey) <- names(pred) <- c("Estimate","95% LCI","95% UCI") -prey
    #> Estimate 95% LCI 95% UCI -#> 45.4 30.2 56.8
    pred
    #> Estimate 95% LCI 95% UCI +prey <- c(45.4,30.2,56.8) +pred <- c(24.5,10.2,36.7) +names(prey) <- names(pred) <- c("Estimate","95% LCI","95% UCI") +prey +
    #> Estimate 95% LCI 95% UCI +#> 45.4 30.2 56.8
    pred +
    #> Estimate 95% LCI 95% UCI #> 24.5 10.2 36.7
    -tictactoe()
    if (require(plotrix)) { - plotCI(prey[1],pred[1],li=prey[2],ui=prey[3],err="x",pch=16,add=TRUE) - plotCI(prey[1],pred[1],li=pred[2],ui=pred[3],err="y",pch=16,add=TRUE) -}
    #> Loading required package: plotrix
    +tictactoe() +
    if (require(plotrix)) { + plotCI(prey[1],pred[1],li=prey[2],ui=prey[3],err="x",pch=16,add=TRUE) + plotCI(prey[1],pred[1],li=pred[2],ui=pred[3],err="y",pch=16,add=TRUE) +} +
    #> Loading required package: plotrix
    ## Create hypothetical data for plotting three points ... similar to what might come from psdCalc() -prey <- rbind(c(45.4,30.2,56.8), - c(68.2,56.7,79.4), - c(17.1, 9.5,26.3)) -pred <- rbind(c(24.5,10.2,36.7), - c(14.2, 7.1,21.3), - c(16.3, 8.2,24.4)) -colnames(prey) <- colnames(pred) <- c("Estimate","95% LCI","95% UCI") -prey
    #> Estimate 95% LCI 95% UCI +prey <- rbind(c(45.4,30.2,56.8), + c(68.2,56.7,79.4), + c(17.1, 9.5,26.3)) +pred <- rbind(c(24.5,10.2,36.7), + c(14.2, 7.1,21.3), + c(16.3, 8.2,24.4)) +colnames(prey) <- colnames(pred) <- c("Estimate","95% LCI","95% UCI") +prey +
    #> Estimate 95% LCI 95% UCI #> [1,] 45.4 30.2 56.8 #> [2,] 68.2 56.7 79.4 -#> [3,] 17.1 9.5 26.3
    pred
    #> Estimate 95% LCI 95% UCI +#> [3,] 17.1 9.5 26.3
    pred +
    #> Estimate 95% LCI 95% UCI #> [1,] 24.5 10.2 36.7 #> [2,] 14.2 7.1 21.3 #> [3,] 16.3 8.2 24.4
    -tictactoe()
    if (require(plotrix)) { - plotCI(prey[,1],pred[,1],li=prey[,2],ui=prey[,3],err="x",pch=16,add=TRUE) - plotCI(prey[,1],pred[,1],li=pred[,2],ui=pred[,3],err="y",pch=16,add=TRUE) -}
    lines(prey[,1],pred[,1])
    text(prey[,1],pred[,1],labels=c(2010,2011,2012),adj=c(-0.5,-0.5))
    +tictactoe() +
    if (require(plotrix)) { + plotCI(prey[,1],pred[,1],li=prey[,2],ui=prey[,3],err="x",pch=16,add=TRUE) + plotCI(prey[,1],pred[,1],li=pred[,2],ui=pred[,3],err="y",pch=16,add=TRUE) +} +
    lines(prey[,1],pred[,1]) +
    text(prey[,1],pred[,1],labels=c(2010,2011,2012),adj=c(-0.5,-0.5)) +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/validn.html b/docs/reference/validn.html index e243efa2..ebd71155 100644 --- a/docs/reference/validn.html +++ b/docs/reference/validn.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,7 +128,7 @@

    Finds the number of valid (non-NA) values in a vector.

    Finds the number of valid (non-NA) values in a vector.

    -
    validn(object)
    +
    validn(object)

    Arguments

    @@ -148,16 +148,25 @@

    <

    See also

    See valid.n in plotrix and nobs in gdata for similar functionality. See is.na for finding the missing values.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    -
    junk1 <- c(1,7,2,4,3,10,NA) -junk2 <- c("Derek","Hugh","Ogle","Santa","Claus","Nick",NA,NA) -junk3 <- factor(junk2) -junk4 <- c(TRUE,TRUE,FALSE,FALSE,FALSE,TRUE,NA,NA) -junk5 <- data.frame(junk1) -junk6 <- data.frame(junk3) - -validn(junk1)
    #> [1] 6
    validn(junk2)
    #> [1] 6
    validn(junk3)
    #> [1] 6
    validn(junk4)
    #> [1] 6
    validn(junk5)
    #> [1] 6
    validn(junk6)
    #> [1] 6
    +
    junk1 <- c(1,7,2,4,3,10,NA) +junk2 <- c("Derek","Hugh","Ogle","Santa","Claus","Nick",NA,NA) +junk3 <- factor(junk2) +junk4 <- c(TRUE,TRUE,FALSE,FALSE,FALSE,TRUE,NA,NA) +junk5 <- data.frame(junk1) +junk6 <- data.frame(junk3) + +validn(junk1) +
    #> [1] 6
    validn(junk2) +
    #> [1] 6
    validn(junk3) +
    #> [1] 6
    validn(junk4) +
    #> [1] 6
    validn(junk5) +
    #> [1] 6
    validn(junk6) +
    #> [1] 6
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/vbStarts-1.png b/docs/reference/vbStarts-1.png index 944ab1e5..7a8e76d6 100644 Binary files a/docs/reference/vbStarts-1.png and b/docs/reference/vbStarts-1.png differ diff --git a/docs/reference/vbStarts-10.png b/docs/reference/vbStarts-10.png index 57f89231..47d18e73 100644 Binary files a/docs/reference/vbStarts-10.png and b/docs/reference/vbStarts-10.png differ diff --git a/docs/reference/vbStarts-11.png b/docs/reference/vbStarts-11.png index 75d2c04e..640f5655 100644 Binary files a/docs/reference/vbStarts-11.png and b/docs/reference/vbStarts-11.png differ diff --git a/docs/reference/vbStarts-12.png b/docs/reference/vbStarts-12.png index a864061f..ebd322bd 100644 Binary files a/docs/reference/vbStarts-12.png and b/docs/reference/vbStarts-12.png differ diff --git a/docs/reference/vbStarts-13.png b/docs/reference/vbStarts-13.png index 9d2109e5..449ff299 100644 Binary files a/docs/reference/vbStarts-13.png and b/docs/reference/vbStarts-13.png differ diff --git a/docs/reference/vbStarts-14.png b/docs/reference/vbStarts-14.png index 886669fb..c9cf4ab4 100644 Binary files a/docs/reference/vbStarts-14.png and b/docs/reference/vbStarts-14.png differ diff --git a/docs/reference/vbStarts-15.png b/docs/reference/vbStarts-15.png index 1b1e606a..cb4b0bad 100644 Binary files a/docs/reference/vbStarts-15.png and b/docs/reference/vbStarts-15.png differ diff --git a/docs/reference/vbStarts-2.png b/docs/reference/vbStarts-2.png index f4312014..dbc72c30 100644 Binary files a/docs/reference/vbStarts-2.png and b/docs/reference/vbStarts-2.png differ diff --git a/docs/reference/vbStarts-3.png b/docs/reference/vbStarts-3.png index 1d8af581..1db47bf9 100644 Binary files a/docs/reference/vbStarts-3.png and b/docs/reference/vbStarts-3.png differ diff --git a/docs/reference/vbStarts-4.png b/docs/reference/vbStarts-4.png index 0ca00e98..c9c0acd8 100644 Binary files a/docs/reference/vbStarts-4.png and b/docs/reference/vbStarts-4.png differ diff --git a/docs/reference/vbStarts-5.png b/docs/reference/vbStarts-5.png index 7718870a..0e614e50 100644 Binary files a/docs/reference/vbStarts-5.png and b/docs/reference/vbStarts-5.png differ diff --git a/docs/reference/vbStarts-6.png b/docs/reference/vbStarts-6.png index 4b9d8c40..116c1e23 100644 Binary files a/docs/reference/vbStarts-6.png and b/docs/reference/vbStarts-6.png differ diff --git a/docs/reference/vbStarts-7.png b/docs/reference/vbStarts-7.png index 40dcfc3d..13dd7733 100644 Binary files a/docs/reference/vbStarts-7.png and b/docs/reference/vbStarts-7.png differ diff --git a/docs/reference/vbStarts-8.png b/docs/reference/vbStarts-8.png index 1d1b3399..9c95e90e 100644 Binary files a/docs/reference/vbStarts-8.png and b/docs/reference/vbStarts-8.png differ diff --git a/docs/reference/vbStarts-9.png b/docs/reference/vbStarts-9.png index 5dfa3a74..df136760 100644 Binary files a/docs/reference/vbStarts-9.png and b/docs/reference/vbStarts-9.png differ diff --git a/docs/reference/vbStarts.html b/docs/reference/vbStarts.html index e6a40dde..32423598 100644 --- a/docs/reference/vbStarts.html +++ b/docs/reference/vbStarts.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,29 +128,29 @@

    Find reasonable starting values for a von Bertalanffy growth function.

    Finds reasonable starting values for the parameters in a specific parameterization of the von Bertalanffy growth function.

    -
    vbStarts(
    -  formula,
    -  data = NULL,
    -  param = c("Typical", "typical", "Traditional", "traditional", "BevertonHolt",
    +    
    vbStarts(
    +  formula,
    +  data = NULL,
    +  param = c("Typical", "typical", "Traditional", "traditional", "BevertonHolt",
         "Original", "original", "vonBertalanffy", "GQ", "GallucciQuinn", "Mooij", "Weisberg",
    -    "Ogle", "Schnute", "Francis", "Somers", "Somers2", "Pauly"),
    -  type = param,
    -  fixed = NULL,
    -  meth0 = c("yngAge", "poly"),
    -  methLinf = c("Walford", "oldAge", "longFish"),
    -  num4Linf = 1,
    -  ages2use = NULL,
    -  methEV = c("means", "poly"),
    -  valOgle = NULL,
    -  plot = FALSE,
    -  col.mdl = "gray70",
    -  lwd.mdl = 3,
    -  lty.mdl = 1,
    -  cex.main = 0.9,
    -  col.main = "red",
    -  dynamicPlot = FALSE,
    -  ...
    -)
    + "Ogle", "Schnute", "Francis", "Somers", "Somers2", "Pauly"), + type = param, + fixed = NULL, + meth0 = c("yngAge", "poly"), + methLinf = c("Walford", "oldAge", "longFish"), + num4Linf = 1, + ages2use = NULL, + methEV = c("means", "poly"), + valOgle = NULL, + plot = FALSE, + col.mdl = "gray70", + lwd.mdl = 3, + lty.mdl = 1, + cex.main = 0.9, + col.main = "red", + dynamicPlot = FALSE, + ... +)

    Arguments

    @@ -248,15 +248,19 @@

    <

    12-Individual Growth.

    References

    -

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

    +

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

    See references in vbFuns.

    See also

    See growthFunShow to display the equations for the parameterizations used in FSA and vbFuns for functions that represent the von Bertalanffy parameterizations. See nlsTracePlot for help troubleshooting nonlinear models that don't converge.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Simple examples of each parameterization -vbStarts(tl~age,data=SpotVA1)
    #> $Linf +vbStarts(tl~age,data=SpotVA1) +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -264,7 +268,8 @@

    Examp #> #> $t0 #> [1] -2.124367 -#>

    vbStarts(tl~age,data=SpotVA1,type="Original")
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Original") +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -272,7 +277,8 @@

    Examp #> #> $L0 #> [1] 7.732 -#>

    vbStarts(tl~age,data=SpotVA1,type="GQ")
    #> $omega +#>
    vbStarts(tl~age,data=SpotVA1,type="GQ") +
    #> $omega #> [1] 5.459258 #> #> $K @@ -280,7 +286,8 @@

    Examp #> #> $t0 #> [1] -2.124367 -#>

    vbStarts(tl~age,data=SpotVA1,type="Mooij")
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Mooij") +
    #> $Linf #> [1] 13.26773 #> #> $L0 @@ -288,7 +295,8 @@

    Examp #> #> $omega #> [1] 5.459258 -#>

    vbStarts(tl~age,data=SpotVA1,type="Weisberg")
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Weisberg") +
    #> $Linf #> [1] 13.26773 #> #> $t50 @@ -296,7 +304,8 @@

    Examp #> #> $t0 #> [1] -2.124367 -#>

    vbStarts(tl~age,data=SpotVA1,type="Francis",ages2use=c(0,5))
    #> $L1 +#>
    vbStarts(tl~age,data=SpotVA1,type="Francis",ages2use=c(0,5)) +
    #> $L1 #> [1] 7.732 #> #> $L2 @@ -304,7 +313,8 @@

    Examp #> #> $L3 #> [1] 12.4 -#>

    vbStarts(tl~age,data=SpotVA1,type="Schnute",ages2use=c(0,5))
    #> $L1 +#>
    vbStarts(tl~age,data=SpotVA1,type="Schnute",ages2use=c(0,5)) +
    #> $L1 #> [1] 7.732 #> #> $L3 @@ -312,7 +322,8 @@

    Examp #> #> $K #> [1] 0.4114688 -#>

    vbStarts(tl~age,data=SpotVA1,type="Somers")
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Somers") +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -326,7 +337,8 @@

    Examp #> #> $ts #> [1] 0.3 -#>

    vbStarts(tl~age,data=SpotVA1,type="Somers2")
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Somers2") +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -340,7 +352,8 @@

    Examp #> #> $WP #> [1] 0.8 -#>

    vbStarts(tl~age,data=SpotVA1,type="Pauly")
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Pauly") +
    #> $Linf #> [1] 13.26773 #> #> $Kpr @@ -354,7 +367,8 @@

    Examp #> #> $NGT #> [1] 0.3 -#>

    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(tr=0))
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(tr=0)) +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -362,7 +376,8 @@

    Examp #> #> $Lr #> [1] 7.274961 -#>

    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(Lr=8))
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(Lr=8)) +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -372,7 +387,8 @@

    Examp #> [1] 0.7521688 #>

    ## Using a different method to find Linf -vbStarts(tl~age,data=SpotVA1,methLinf="oldAge")
    #> $Linf +vbStarts(tl~age,data=SpotVA1,methLinf="oldAge") +
    #> $Linf #> [1] 12.4 #> #> $K @@ -380,7 +396,8 @@

    Examp #> #> $t0 #> [1] -2.374338 -#>

    vbStarts(tl~age,data=SpotVA1,methLinf="oldAge",num4Linf=2)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,methLinf="oldAge",num4Linf=2) +
    #> $Linf #> [1] 12.40625 #> #> $K @@ -388,7 +405,8 @@

    Examp #> #> $t0 #> [1] -2.37231 -#>

    vbStarts(tl~age,data=SpotVA1,methLinf="longFish")
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,methLinf="longFish") +
    #> $Linf #> [1] 13.9 #> #> $K @@ -396,7 +414,8 @@

    Examp #> #> $t0 #> [1] -1.974668 -#>

    vbStarts(tl~age,data=SpotVA1,methLinf="longFish",num4Linf=10)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,methLinf="longFish",num4Linf=10) +
    #> $Linf #> [1] 13.64 #> #> $K @@ -404,7 +423,8 @@

    Examp #> #> $t0 #> [1] -2.033445 -#>

    vbStarts(tl~age,data=SpotVA1,type="Original",methLinf="oldAge")
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Original",methLinf="oldAge") +
    #> $Linf #> [1] 12.4 #> #> $K @@ -412,7 +432,8 @@

    Examp #> #> $L0 #> [1] 7.732 -#>

    vbStarts(tl~age,data=SpotVA1,type="Original",methLinf="oldAge",num4Linf=2)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Original",methLinf="oldAge",num4Linf=2) +
    #> $Linf #> [1] 12.40625 #> #> $K @@ -420,7 +441,8 @@

    Examp #> #> $L0 #> [1] 7.732 -#>

    vbStarts(tl~age,data=SpotVA1,type="Original",methLinf="longFish")
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Original",methLinf="longFish") +
    #> $Linf #> [1] 13.9 #> #> $K @@ -428,7 +450,8 @@

    Examp #> #> $L0 #> [1] 7.732 -#>

    vbStarts(tl~age,data=SpotVA1,type="Original",methLinf="longFish",num4Linf=10)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Original",methLinf="longFish",num4Linf=10) +
    #> $Linf #> [1] 13.64 #> #> $K @@ -436,7 +459,8 @@

    Examp #> #> $L0 #> [1] 7.732 -#>

    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(tr=0),methLinf="oldAge",num4Linf=2)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(tr=0),methLinf="oldAge",num4Linf=2) +
    #> $Linf #> [1] 12.40625 #> #> $K @@ -444,7 +468,8 @@

    Examp #> #> $Lr #> [1] 7.274961 -#>

    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(Lr=8),methLinf="longFish",num4Linf=10)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(Lr=8),methLinf="longFish",num4Linf=10) +
    #> $Linf #> [1] 13.64 #> #> $K @@ -454,7 +479,8 @@

    Examp #> [1] 0.7521688 #>

    ## Using a different method to find t0 and L0 -vbStarts(tl~age,data=SpotVA1,meth0="yngAge")
    #> $Linf +vbStarts(tl~age,data=SpotVA1,meth0="yngAge") +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -462,7 +488,8 @@

    Examp #> #> $t0 #> [1] -2.124367 -#>

    vbStarts(tl~age,data=SpotVA1,type="original",meth0="yngAge")
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="original",meth0="yngAge") +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -472,7 +499,8 @@

    Examp #> [1] 7.732 #>

    ## Using a different method to find the L1, L2, and L3 -vbStarts(tl~age,data=SpotVA1,type="Francis",ages2use=c(0,5),methEV="means")
    #> $L1 +vbStarts(tl~age,data=SpotVA1,type="Francis",ages2use=c(0,5),methEV="means") +
    #> $L1 #> [1] 7.732 #> #> $L2 @@ -480,7 +508,8 @@

    Examp #> #> $L3 #> [1] 12.4 -#>

    vbStarts(tl~age,data=SpotVA1,type="Schnute",ages2use=c(0,5),methEV="means")
    #> $L1 +#>
    vbStarts(tl~age,data=SpotVA1,type="Schnute",ages2use=c(0,5),methEV="means") +
    #> $L1 #> [1] 7.732 #> #> $L3 @@ -490,7 +519,8 @@

    Examp #> [1] 0.4114688 #>

    ## Examples with a Plot -vbStarts(tl~age,data=SpotVA1,plot=TRUE)
    #> $Linf +vbStarts(tl~age,data=SpotVA1,plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -498,7 +528,8 @@

    Examp #> #> $t0 #> [1] -2.124367 -#>

    vbStarts(tl~age,data=SpotVA1,type="original",plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="original",plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -506,7 +537,8 @@

    Examp #> #> $L0 #> [1] 7.732 -#>

    vbStarts(tl~age,data=SpotVA1,type="GQ",plot=TRUE)
    #> $omega +#>
    vbStarts(tl~age,data=SpotVA1,type="GQ",plot=TRUE) +
    #> $omega #> [1] 5.459258 #> #> $K @@ -514,7 +546,8 @@

    Examp #> #> $t0 #> [1] -2.124367 -#>

    vbStarts(tl~age,data=SpotVA1,type="Mooij",plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Mooij",plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $L0 @@ -522,7 +555,8 @@

    Examp #> #> $omega #> [1] 5.459258 -#>

    vbStarts(tl~age,data=SpotVA1,type="Weisberg",plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Weisberg",plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $t50 @@ -530,7 +564,8 @@

    Examp #> #> $t0 #> [1] -2.124367 -#>

    vbStarts(tl~age,data=SpotVA1,type="Francis",ages2use=c(0,5),plot=TRUE)
    #> $L1 +#>
    vbStarts(tl~age,data=SpotVA1,type="Francis",ages2use=c(0,5),plot=TRUE) +
    #> $L1 #> [1] 7.732 #> #> $L2 @@ -538,7 +573,8 @@

    Examp #> #> $L3 #> [1] 12.4 -#>

    vbStarts(tl~age,data=SpotVA1,type="Schnute",ages2use=c(0,5),plot=TRUE)
    #> $L1 +#>
    vbStarts(tl~age,data=SpotVA1,type="Schnute",ages2use=c(0,5),plot=TRUE) +
    #> $L1 #> [1] 7.732 #> #> $L3 @@ -546,7 +582,8 @@

    Examp #> #> $K #> [1] 0.4114688 -#>

    vbStarts(tl~age,data=SpotVA1,type="Somers",plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Somers",plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -560,7 +597,8 @@

    Examp #> #> $ts #> [1] 0.3 -#>

    vbStarts(tl~age,data=SpotVA1,type="Somers2",plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Somers2",plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -574,7 +612,8 @@

    Examp #> #> $WP #> [1] 0.8 -#>

    vbStarts(tl~age,data=SpotVA1,type="Pauly",plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Pauly",plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $Kpr @@ -588,7 +627,8 @@

    Examp #> #> $NGT #> [1] 0.3 -#>

    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(tr=0),plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(tr=0),plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -596,7 +636,8 @@

    Examp #> #> $Lr #> [1] 7.274961 -#>

    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(Lr=8),plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(Lr=8),plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -606,7 +647,8 @@

    Examp #> [1] 0.7521688 #>

    ## Examples where some parameters are fixed by the user -vbStarts(tl~age,data=SpotVA1,fixed=list(Linf=15))
    #> $Linf +vbStarts(tl~age,data=SpotVA1,fixed=list(Linf=15)) +
    #> $Linf #> [1] 15 #> #> $K @@ -614,7 +656,8 @@

    Examp #> #> $t0 #> [1] -1.760933 -#>

    vbStarts(tl~age,data=SpotVA1,fixed=list(Linf=15,K=0.3))
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,fixed=list(Linf=15,K=0.3)) +
    #> $Linf #> [1] 15 #> #> $K @@ -622,7 +665,8 @@

    Examp #> #> $t0 #> [1] -2.41523 -#>

    vbStarts(tl~age,data=SpotVA1,fixed=list(Linf=15,K=0.3,t0=-1))
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,fixed=list(Linf=15,K=0.3,t0=-1)) +
    #> $Linf #> [1] 15 #> #> $K @@ -630,7 +674,8 @@

    Examp #> #> $t0 #> [1] -1 -#>

    vbStarts(tl~age,data=SpotVA1,fixed=list(Linf=15,K=0.3,t0=-1),plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,fixed=list(Linf=15,K=0.3,t0=-1),plot=TRUE) +
    #> $Linf #> [1] 15 #> #> $K @@ -638,7 +683,8 @@

    Examp #> #> $t0 #> [1] -1 -#>

    vbStarts(tl~age,data=SpotVA1,type="Pauly",fixed=list(t0=-1.5),plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Pauly",fixed=list(t0=-1.5),plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $Kpr @@ -652,7 +698,8 @@

    Examp #> #> $NGT #> [1] 0.3 -#>

    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(tr=2),fixed=list(Lr=10),plot=TRUE)
    #> $Linf +#>
    vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(tr=2),fixed=list(Lr=10),plot=TRUE) +
    #> $Linf #> [1] 13.26773 #> #> $K @@ -661,7 +708,7 @@

    Examp #> $Lr #> [1] 10 #>

    -## See examples in vbFuns() for use of vbStarts() when fitting Von B models +## See examples in vbFuns() for use of vbStarts() when fitting Von B models
    @@ -679,7 +726,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/wrAdd.html b/docs/reference/wrAdd.html index bc4e5d51..ef7399e0 100644 --- a/docs/reference/wrAdd.html +++ b/docs/reference/wrAdd.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,13 +128,13 @@

    Computes a vector of relative weights specific to a species in an entire dat

    This computes a vector that contains the relative weight specific to each species for all individuals in an entire data frame.

    -
    wrAdd(wt, ...)
    +    
    wrAdd(wt, ...)
     
     # S3 method for default
    -wrAdd(wt, len, spec, units = c("metric", "English"), ...)
    +wrAdd(wt, len, spec, units = c("metric", "English"), ...)
     
     # S3 method for formula
    -wrAdd(wt, data, units = c("metric", "English"), ...)
    +wrAdd(wt, data, units = c("metric", "English"), ...)

    Arguments

    @@ -176,36 +176,41 @@

    <

    8-Condition.

    References

    -

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

    +

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

    See also

    See wsVal, WSlit, and psdAdd for related functionality. See mapvalues for help in changing species names to match those in WSlit.

    +

    Author

    + +

    Derek H. Ogle, derek@derekogle.com

    Examples

    ## Create random data for three species # just to control the randomization -set.seed(345234534) -dbt <- data.frame(species=factor(rep(c("Bluefin Tuna"),30)),tl=round(rnorm(30,1900,300),0)) -dbt$wt <- round(4.5e-05*dbt$tl^2.8+rnorm(30,0,6000),1) -dbg <- data.frame(species=factor(rep(c("Bluegill"),30)),tl=round(rnorm(30,130,50),0)) -dbg$wt <- round(4.23e-06*dbg$tl^3.316+rnorm(30,0,10),1) -dlb <- data.frame(species=factor(rep(c("Largemouth Bass"),30)),tl=round(rnorm(30,350,60),0)) -dlb$wt <- round(2.96e-06*dlb$tl^3.273+rnorm(30,0,60),1) -df <- rbind(dbt,dbg,dlb) -str(df)
    #> 'data.frame': 90 obs. of 3 variables: +set.seed(345234534) +dbt <- data.frame(species=factor(rep(c("Bluefin Tuna"),30)),tl=round(rnorm(30,1900,300),0)) +dbt$wt <- round(4.5e-05*dbt$tl^2.8+rnorm(30,0,6000),1) +dbg <- data.frame(species=factor(rep(c("Bluegill"),30)),tl=round(rnorm(30,130,50),0)) +dbg$wt <- round(4.23e-06*dbg$tl^3.316+rnorm(30,0,10),1) +dlb <- data.frame(species=factor(rep(c("Largemouth Bass"),30)),tl=round(rnorm(30,350,60),0)) +dlb$wt <- round(2.96e-06*dlb$tl^3.273+rnorm(30,0,60),1) +df <- rbind(dbt,dbg,dlb) +str(df) +
    #> 'data.frame': 90 obs. of 3 variables: #> $ species: Factor w/ 3 levels "Bluefin Tuna",..: 1 1 1 1 1 1 1 1 1 1 ... #> $ tl : num 1371 1558 2031 2226 2124 ... #> $ wt : num 19231 38147 90530 104718 88761 ...
    -df$Wr1 <- wrAdd(wt~tl+species,data=df) +df$Wr1 <- wrAdd(wt~tl+species,data=df) ## same but with non-formula interface -df$Wr2 <- wrAdd(df$wt,df$tl,df$species) +df$Wr2 <- wrAdd(df$wt,df$tl,df$species) ## Same as above but using dplyr -if (require(dplyr)) { - df <- mutate(df,Wr3a=wrAdd(wt,tl,species)) -} +if (require(dplyr)) { + df <- mutate(df,Wr3a=wrAdd(wt,tl,species)) +} -df
    #> species tl wt Wr1 Wr2 Wr3a +df +
    #> species tl wt Wr1 Wr2 Wr3a #> 1 Bluefin Tuna 1371 19231.0 NA NA NA #> 2 Bluefin Tuna 1558 38146.9 NA NA NA #> 3 Bluefin Tuna 2031 90530.4 NA NA NA @@ -295,10 +300,12 @@

    Examp #> 87 Largemouth Bass 260 182.4 76.70383 76.70383 76.70383 #> 88 Largemouth Bass 441 1288.2 96.10274 96.10274 96.10274 #> 89 Largemouth Bass 266 265.7 103.69408 103.69408 103.69408 -#> 90 Largemouth Bass 371 612.6 80.46670 80.46670 80.46670

    +#> 90 Largemouth Bass 371 612.6 80.46670 80.46670 80.46670
    ## Example with only one species in the data.frame -bg <- filterD(df,species=="Bluegill") -bg$Wr4 <- wrAdd(wt~tl+species,data=bg)
    +bg<-filterD(df,species=="Bluegill") +bg$Wr4<-wrAdd(wt~tl+species,data=bg) + +
    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/wsVal.html b/docs/reference/wsVal.html index 2755a234..c5062f34 100644 --- a/docs/reference/wsVal.html +++ b/docs/reference/wsVal.html @@ -80,7 +80,7 @@ FSA - 0.8.30.9000 + 0.8.31 @@ -128,12 +128,12 @@

    Finds standard weight equation coefficients for a particular species.

    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.

    -
    wsVal(
    -  species = "List",
    -  units = c("metric", "English"),
    -  ref = 75,
    -  simplify = FALSE
    -)
    +
    wsVal(
    +  species = "List",
    +  units = c("metric", "English"),
    +  ref = 75,
    +  simplify = FALSE
    +)

    Arguments

    @@ -171,13 +171,17 @@

    <

    8-Condition.

    References

    -

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

    +

    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, derek@derekogle.com

    Examples

    -
    wsVal()
    #> +
    wsVal() +
    #> #> Species name must be one of following. Be careful of spelling and capitalization.
    #> [1] "Aegean Chub" "Bigmouth Buffalo" #> [3] "Bigmouth Sleepers (all)" "Bigmouth Sleepers (lotic)" #> [5] "Black Bullhead" "Black Crappie" @@ -223,14 +227,20 @@

    Examp #> [85] "White Catfish" "White Crappie" #> [87] "White Perch" "White Sturgeon" #> [89] "White Sucker" "Yellow Bass" -#> [91] "Yellow Bullhead" "Yellow Perch"

    wsVal("Bluegill")
    #> species units type ref measure method min.TL int slope source -#> 20 Bluegill metric linear 75 TL Other 80 -5.374 3.316 Hillman (1982)
    wsVal("Bluegill",units="metric")
    #> species units type ref measure method min.TL int slope source -#> 20 Bluegill metric linear 75 TL Other 80 -5.374 3.316 Hillman (1982)
    wsVal("Bluegill",units="English")
    #> species units type ref measure method min.TL int slope +#> [91] "Yellow Bullhead" "Yellow Perch"
    wsVal("Bluegill") +
    #> species units type ref measure method min.TL int slope source +#> 20 Bluegill metric linear 75 TL Other 80 -5.374 3.316 Hillman (1982)
    wsVal("Bluegill",units="metric") +
    #> species units type ref measure method min.TL int slope source +#> 20 Bluegill metric linear 75 TL Other 80 -5.374 3.316 Hillman (1982)
    wsVal("Bluegill",units="English") +
    #> species units type ref measure method min.TL int slope #> 19 Bluegill English linear 75 TL Other 3 -3.371 3.316 #> source -#> 19 Hillman (1982)
    wsVal("Bluegill",units="English",simplify=TRUE)
    #> species min.TL int slope -#> 19 Bluegill 3 -3.371 3.316
    wsVal("Ruffe",units="metric",simplify=TRUE)
    #> species min.TL max.TL int slope quad -#> 131 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 +#> 19 Hillman (1982)
    wsVal("Bluegill",units="English",simplify=TRUE) +
    #> species min.TL int slope +#> 19 Bluegill 3 -3.371 3.316
    wsVal("Ruffe",units="metric",simplify=TRUE) +
    #> species min.TL max.TL int slope quad +#> 131 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 #> 130 Ruffe 55 205 -3.3524 1.3969 0.4054
    @@ -248,7 +258,7 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/man/ALKAgeDist.Rd b/man/ALKAgeDist.Rd index 5afb04bc..25de6ea7 100644 --- a/man/ALKAgeDist.Rd +++ b/man/ALKAgeDist.Rd @@ -58,7 +58,7 @@ alkAgeDist(WR1.key,lenA.n,len.n) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Lai, H.-L. 1987. Optimum allocation for estimating age composition using age-length key. Fishery Bulletin, 85:179-185. diff --git a/man/ALKMeanVar.Rd b/man/ALKMeanVar.Rd index 4f126b46..e9c12b9e 100644 --- a/man/ALKMeanVar.Rd +++ b/man/ALKMeanVar.Rd @@ -71,7 +71,7 @@ alkMeanVar(WR1.key,len~LCat+age,WR1.age,len.n,method="QuinnDeriso") } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Bettoli, P. W. and Miranda, L. E. 2001. A cautionary note about estimating mean length at age with subsampled data. North American Journal of Fisheries Management, 21:425-428. diff --git a/man/FSA.Rd b/man/FSA.Rd index ff081e21..d181531a 100644 --- a/man/FSA.Rd +++ b/man/FSA.Rd @@ -10,15 +10,15 @@ Functions to support basic fisheries stock assessment methods. \details{ Functions from this package can be used to perform a variety of basic fisheries stock assessment methods. Detailed descriptions for most functions are available in the \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analysis with R} book (Ogle 2016). Vignettes for the boxed examples in the \dQuote{Analysis and Interpretation of Freshwater Fisheries Data} book can be viewed with \code{fishR("AIFFD")}. -Questions, comments, or suggestions should be given on the \href{https://github.com/droglenc/FSA/issues}{GitHub FSA Issues page}. +Questions, comments, or suggestions should be given on the \href{https://github.com/droglenc/FSA/issues/}{GitHub FSA Issues page}. Packages with related functionality by the same author are \itemize{ - \item The \href{https://github.com/droglenc/FSAdata}{FSAdata package} contains additional data sets. - \item The \href{https://github.com/droglenc/FSAsim}{FSAsim package} simulation routines for various fisheries methods. - \item The \href{https://github.com/droglenc/FSAWs}{FSAWs package} contains functions for developing and validating standard weight equations. + \item The \href{https://github.com/droglenc/FSAdata/}{FSAdata package} contains additional data sets. + \item The \href{https://github.com/droglenc/FSAsim/}{FSAsim package} simulation routines for various fisheries methods. + \item The \href{https://github.com/droglenc/FSAWs/}{FSAWs package} contains functions for developing and validating standard weight equations. } } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } diff --git a/man/PSDlit.Rd b/man/PSDlit.Rd index 44c7b418..4ffcf789 100644 --- a/man/PSDlit.Rd +++ b/man/PSDlit.Rd @@ -46,7 +46,7 @@ head(PSDlit) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \seealso{ See \code{\link{psdVal}}, \code{\link{psdCalc}}, \code{\link{psdPlot}}, \code{\link{psdAdd}}, and \code{\link{tictactoe}} for related functionality. diff --git a/man/WSlit.Rd b/man/WSlit.Rd index 6c1e576e..d3499636 100644 --- a/man/WSlit.Rd +++ b/man/WSlit.Rd @@ -52,7 +52,7 @@ head(WSlit) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \seealso{ See \code{\link{wsVal}} and \code{\link{wrAdd}} for related functionality. diff --git a/man/addZeroCatch.Rd b/man/addZeroCatch.Rd index 7be215ea..e7f74199 100644 --- a/man/addZeroCatch.Rd +++ b/man/addZeroCatch.Rd @@ -124,7 +124,7 @@ df6mod1 } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \seealso{ \code{complete} in \pkg{tidyr} package. diff --git a/man/ageBias.Rd b/man/ageBias.Rd index 46fff942..85844660 100644 --- a/man/ageBias.Rd +++ b/man/ageBias.Rd @@ -325,7 +325,7 @@ par(op) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Campana, S.E., M.C. Annand, and J.I. McMillan. 1995. Graphical and statistical methods for determining the consistency of age determinations. Transactions of the American Fisheries Society 124:131-138. [Was (is?) available from http://www.bio.gc.ca/otoliths/documents/Campana\%20et\%20al\%201995\%20TAFS.pdf.] diff --git a/man/agePrecision.Rd b/man/agePrecision.Rd index 647c7fab..1aecf054 100644 --- a/man/agePrecision.Rd +++ b/man/agePrecision.Rd @@ -68,10 +68,10 @@ If \code{what="precision"} in \code{summary} then a summary table that contains \item R Number of age estimates given in \code{formula}. \item PercAgree The percentage of fish for which all age estimates perfectly agree. \item ASD The average (across all fish) standard deviation of ages within a fish. - \item ACV The average (across all fish) coefficient of variation of ages within a fish using the \bold{mean} as the divisor. See the \href{http://derekogle.com/IFAR}{IFAR chapter} for calculation details. + \item ACV The average (across all fish) coefficient of variation of ages within a fish using the \bold{mean} as the divisor. See the \href{http://derekogle.com/IFAR/}{IFAR chapter} for calculation details. \item ACV2 The average (across all fish) coefficient of variation of ages within a fish using the \bold{median} as the divisor. This will only be shown if R>2 or \code{show.prec2=TRUE}. \item AAD The average (across all fish) absolute deviation of ages within a fish. - \item APE The average (across all fish) percent error of ages within a fish using the \bold{mean} as the divisor. See the \href{http://derekogle.com/IFAR}{IFAR chapter} for calculation details. + \item APE The average (across all fish) percent error of ages within a fish using the \bold{mean} as the divisor. See the \href{http://derekogle.com/IFAR/}{IFAR chapter} for calculation details. \item APE2 The average (across all fish) percent error of ages within a fish using the \bold{median} as the divisor. This will only be shown if R>2 or \code{show.prec2=TRUE}. \item AD The average (across all fish) index of precision (D). } @@ -137,7 +137,7 @@ plot(median~mean,data=ap2$detail,pch=19,col=col2rgbt("black",1/5), } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Beamish, R.J. and D.A. Fournier. 1981. A method for comparing the precision of a set of age determinations. Canadian Journal of Fisheries and Aquatic Sciences 38:982-983. [Was (is?) available from http://www.pac.dfo-mpo.gc.ca/science/people-gens/beamish/PDF_files/compareagecjfas1981.pdf.] diff --git a/man/alkIndivAge.Rd b/man/alkIndivAge.Rd index 25a910e6..6b44a023 100644 --- a/man/alkIndivAge.Rd +++ b/man/alkIndivAge.Rd @@ -20,7 +20,7 @@ alkIndivAge( \item{data}{A data.frame that minimally contains the length measurements and possibly contains a variable that will receive the age assignments as given in \code{formula}.} -\item{type}{A string that indicates whether to use the semi-random (\code{type="SR"}, default) or completely-random (\code{type="CR"}) methods for assigning ages to individual fish. See the \href{http://derekogle.com/IFAR}{IFAR chapter} for more details.} +\item{type}{A string that indicates whether to use the semi-random (\code{type="SR"}, default) or completely-random (\code{type="CR"}) methods for assigning ages to individual fish. See the \href{http://derekogle.com/IFAR/}{IFAR chapter} for more details.} \item{breaks}{A numeric vector of lower values that define the length intervals. See details.} @@ -113,7 +113,7 @@ Summarize(len~age,data=WR3.comb,digits=2) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Isermann, D.A. and C.T. Knight. 2005. A computer program for age-length keys incorporating age assignment to individual fish. North American Journal of Fisheries Management, 25:1153-1160. [Was (is?) from http://www.tandfonline.com/doi/abs/10.1577/M04-130.1.] } diff --git a/man/alkPlot.Rd b/man/alkPlot.Rd index 7d1ea122..c4d686fe 100644 --- a/man/alkPlot.Rd +++ b/man/alkPlot.Rd @@ -103,7 +103,7 @@ alkPlot(WR.key,"bubble",grid=rgb(0,0,0,0.2),col=rgb(0,0,0,0.5)) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \seealso{ See \code{\link{alkIndivAge}} for using an age-length key to assign ages to individual fish. diff --git a/man/capHistConvert.Rd b/man/capHistConvert.Rd index 2cb43d6e..da027795 100644 --- a/man/capHistConvert.Rd +++ b/man/capHistConvert.Rd @@ -300,7 +300,7 @@ capHistConvert(df1,id="fish",in.type="event") } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \seealso{ See \code{\link{capHistSum}} to summarize \dQuote{individual} capture histories into a format usable in \code{\link{mrClosed}} and \code{\link{mrOpen}}. Also see \pkg{Rcapture}, \code{RMark}, or \pkg{marked} packages for handling more complex analyses. diff --git a/man/capHistSum.Rd b/man/capHistSum.Rd index 6855d924..8fbdcc3e 100644 --- a/man/capHistSum.Rd +++ b/man/capHistSum.Rd @@ -85,7 +85,7 @@ plot(ch1,what="u") } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Baillargeon, S. and Rivest, L.-P. (2007). Rcapture: Loglinear models for capture-recapture in R. Journal of Statistical Software, 19(5):1-31. } diff --git a/man/catchCurve.Rd b/man/catchCurve.Rd index f3a56503..9873b3ec 100644 --- a/man/catchCurve.Rd +++ b/man/catchCurve.Rd @@ -174,7 +174,7 @@ plot(cc5) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Maceina, M.J., and P.W. Bettoli. 1998. Variation in Largemouth Bass recruitment in four mainstream impoundments on the Tennessee River. North American Journal of Fisheries Management 18:998-1003. diff --git a/man/chapmanRobson.Rd b/man/chapmanRobson.Rd index 3c2de959..bd778c51 100644 --- a/man/chapmanRobson.Rd +++ b/man/chapmanRobson.Rd @@ -145,7 +145,7 @@ plot(cr3) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Chapman, D.G. and D.S. Robson. 1960. The analysis of a catch curve. Biometrics. 16:354-368. diff --git a/man/depletion.Rd b/man/depletion.Rd index 5f88ef2e..1cf4c032 100644 --- a/man/depletion.Rd +++ b/man/depletion.Rd @@ -167,7 +167,7 @@ plot(d2) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Ricker, W.E. 1975. Computation and interpretation of biological statistics of fish populations. Technical Report Bulletin 191, Bulletin of the Fisheries Research Board of Canada. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/1485.pdf.] diff --git a/man/diags.Rd b/man/diags.Rd index 4fd92dc7..3da420ec 100644 --- a/man/diags.Rd +++ b/man/diags.Rd @@ -67,6 +67,6 @@ diags(mat3,which=-4,incl.labels="col") } \author{ -Derek H. Ogle, \email{derek@derekogle.com}, but relied heavily on \url{http://stackoverflow.com/a/27935808/1123933}. +Derek H. Ogle, \email{derek@derekogle.com}, but relied heavily on \url{https://stackoverflow.com/a/27935808/1123933/}. } \keyword{manip} diff --git a/man/growthModels.Rd b/man/growthModels.Rd index b732dc99..3071ad16 100644 --- a/man/growthModels.Rd +++ b/man/growthModels.Rd @@ -286,7 +286,7 @@ text(0.5,0.5,growthFunShow("vonBertalanffy","Francis")) par(op) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Campana, S.E. and C.M. Jones. 1992. Analysis of otolith microstructure data. Pages 73-100 In D.K. Stevenson and S.E. Campana, editors. Otolith microstructure examination and analysis. Canadian Special Publication of Fisheries and Aquatic Sciences 117. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/141734.pdf.] diff --git a/man/headtail.Rd b/man/headtail.Rd index 474dfc17..7118a9fd 100644 --- a/man/headtail.Rd +++ b/man/headtail.Rd @@ -40,14 +40,14 @@ headtail(miris,10) headtail(miris,addrownums=FALSE) headtail(miris,10,which=2:4) -## Make a tbl_df type from dplyr ... note how headtail() +## Make a tbl_df type from tibble ... note how headtail() ## is not limited by the tbl_df restriction on number of ## rows to show (but head() is). -if (require(dplyr)) { - iris2 <- tbl_df(iris) +if (require(tibble)) { + iris2 <- as_tibble(iris) class(iris2) headtail(iris2,n=15) - head(iris2,n=30) + head(iris2,n=15) } } \seealso{ diff --git a/man/hist.formula.Rd b/man/hist.formula.Rd index 4753fbd9..5fd35e6d 100644 --- a/man/hist.formula.Rd +++ b/man/hist.formula.Rd @@ -141,7 +141,7 @@ hist(~vec) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \seealso{ See base \code{\link[graphics]{hist}} for related functionality and \code{\link[plotrix]{multhist}} in \pkg{plotrix} for similar functionality. diff --git a/man/lencat.Rd b/man/lencat.Rd index b6c890f8..d4b8a560 100644 --- a/man/lencat.Rd +++ b/man/lencat.Rd @@ -215,7 +215,7 @@ str(smb2) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \author{ Derek H. Ogle, \email{derek@derekogle.com} diff --git a/man/lwCompPreds.Rd b/man/lwCompPreds.Rd index 51721f04..f046dd3e 100644 --- a/man/lwCompPreds.Rd +++ b/man/lwCompPreds.Rd @@ -127,7 +127,7 @@ par(op) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \author{ Derek H. Ogle, \email{derek@derekogle.com} diff --git a/man/metaM.Rd b/man/metaM.Rd index 8f348d14..c494a020 100644 --- a/man/metaM.Rd +++ b/man/metaM.Rd @@ -142,7 +142,7 @@ metaM(Mmethods("Hoenig"),K=K,Linf=Linf,Temp=Temp,tmax=tmax,t50=t50) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Alverson, D.L. and M.J. Carney. 1975. A graphic review of the growth and decay of population cohorts. Journal du Conseil International pour l'Exploration de la Mer. 36:133-143. diff --git a/man/mrClosed.Rd b/man/mrClosed.Rd index a4f310f5..eab0bbfd 100644 --- a/man/mrClosed.Rd +++ b/man/mrClosed.Rd @@ -264,7 +264,7 @@ confint(mr7) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Krebs, C.J. 1989. Ecological Methodology. Addison-Welsey Educational Publishing. diff --git a/man/mrOpen.Rd b/man/mrOpen.Rd index 389fe131..d1310e70 100644 --- a/man/mrOpen.Rd +++ b/man/mrOpen.Rd @@ -138,7 +138,7 @@ ex3a <- jolly(jolly.top,jolly.bot) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Jolly, G.M. 1965. Explicit estimates from capture-recapture data with both death and immigration -- stochastic model. Biometrika, 52:225-247. diff --git a/man/psdAdd.Rd b/man/psdAdd.Rd index cfd45101..92784532 100644 --- a/man/psdAdd.Rd +++ b/man/psdAdd.Rd @@ -110,7 +110,7 @@ df } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Guy, C.S., R.M. Neumann, and D.W. Willis. 2006. New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS). Fisheries 31:86-87. [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.] diff --git a/man/psdCI.Rd b/man/psdCI.Rd index 19462b8f..2d0874fd 100644 --- a/man/psdCI.Rd +++ b/man/psdCI.Rd @@ -88,7 +88,7 @@ bcis } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Brenden, T.O., T. Wagner, and B.R. Murphy. 2008. Novel tools for analyzing proportional size distribution index data. North American Journal of Fisheries Management 28:1233-1242. [Was (is?) from http://qfc.fw.msu.edu/Publications/Publication\%20List/2008/Novel\%20Tools\%20for\%20Analyzing\%20Proportional\%20Size\%20Distribution_Brenden.pdf.] } diff --git a/man/psdCalc.Rd b/man/psdCalc.Rd index e4fac2dd..5b809e9c 100644 --- a/man/psdCalc.Rd +++ b/man/psdCalc.Rd @@ -109,7 +109,7 @@ psdCalc(~yepmm,data=yepdf,species="Yellow perch",digits=1) } \references{ -Ogle, D.H2016\href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}Chapman & Hall/CRC, Boca Raton, FL. Guy, C.S., R.M. Neumann, and D.W. Willis2006New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS)Fisheries 31:86-87 [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.] diff --git a/man/psdPlot.Rd b/man/psdPlot.Rd index 3c920162..81cc72be 100644 --- a/man/psdPlot.Rd +++ b/man/psdPlot.Rd @@ -135,7 +135,7 @@ par(op) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Guy, C.S., R.M. Neumann, and D.W. Willis. 2006. New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS). Fisheries 31:86-87. [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.] diff --git a/man/psdVal.Rd b/man/psdVal.Rd index 966415e2..71355048 100644 --- a/man/psdVal.Rd +++ b/man/psdVal.Rd @@ -61,7 +61,7 @@ psdVal("Bluegill",units="in",addLens=c("MinSlot"=7,"MaxSlot"=9)) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Guy, C.S., R.M. Neumann, and D.W. Willis. 2006. New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS). Fisheries 31:86-87. [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.] diff --git a/man/removal.Rd b/man/removal.Rd index 0f67623b..87a84645 100644 --- a/man/removal.Rd +++ b/man/removal.Rd @@ -226,7 +226,7 @@ fnl1 } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Carle, F.L. and M.R. Strub. 1978. A new method for estimating population size from removal data. Biometrics, 34:621-630. diff --git a/man/srStarts.Rd b/man/srStarts.Rd index 8ad3af1d..023d5454 100644 --- a/man/srStarts.Rd +++ b/man/srStarts.Rd @@ -92,7 +92,7 @@ srStarts(recruits~stock,data=CodNorwegian,type="independence",plot=TRUE) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Beverton, R.J.H. and S.J. Holt. 1957. On the dynamics of exploited fish populations, Fisheries Investigations (Series 2), volume 19. United Kingdom Ministry of Agriculture and Fisheries, 533 pp. diff --git a/man/stockRecruitment.Rd b/man/stockRecruitment.Rd index 73974c77..32e3634a 100644 --- a/man/stockRecruitment.Rd +++ b/man/stockRecruitment.Rd @@ -112,7 +112,7 @@ text(0.5,0.5,srFunShow("Shepherd")) par(op) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. Beverton, R.J.H. and S.J. Holt. 1957. On the dynamics of exploited fish populations, Fisheries Investigations (Series 2), volume 19. United Kingdom Ministry of Agriculture and Fisheries, 533 pp. diff --git a/man/tictactoe.Rd b/man/tictactoe.Rd index f7e88639..2fe3eb7d 100644 --- a/man/tictactoe.Rd +++ b/man/tictactoe.Rd @@ -83,7 +83,7 @@ text(prey[,1],pred[,1],labels=c(2010,2011,2012),adj=c(-0.5,-0.5)) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \seealso{ See \code{\link{psdVal}} and \code{\link{psdCalc}} for related functionality. diff --git a/man/vbStarts.Rd b/man/vbStarts.Rd index ff574057..f90b03fc 100644 --- a/man/vbStarts.Rd +++ b/man/vbStarts.Rd @@ -152,7 +152,7 @@ vbStarts(tl~age,data=SpotVA1,type="Ogle",valOgle=c(tr=2),fixed=list(Lr=10),plot= } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. See references in \code{\link{vbFuns}}. } diff --git a/man/wrAdd.Rd b/man/wrAdd.Rd index 18e18737..b7af8d3e 100644 --- a/man/wrAdd.Rd +++ b/man/wrAdd.Rd @@ -68,7 +68,7 @@ bg$Wr4 <- wrAdd(wt~tl+species,data=bg) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \seealso{ See \code{\link{wsVal}}, \code{\link{WSlit}}, and \code{\link{psdAdd}} for related functionality. See \code{\link{mapvalues}} for help in changing species names to match those in \code{\link{WSlit}}. diff --git a/man/wsVal.Rd b/man/wsVal.Rd index 12474809..53c61428 100644 --- a/man/wsVal.Rd +++ b/man/wsVal.Rd @@ -52,7 +52,7 @@ wsVal("Ruffe",units="metric",ref=50,simplify=TRUE) } \references{ -Ogle, D.H. 2016. \href{http://derekogle.com/IFAR}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. +Ogle, D.H. 2016. \href{http://derekogle.com/IFAR/}{Introductory Fisheries Analyses with R}. Chapman & Hall/CRC, Boca Raton, FL. } \seealso{ See \code{\link{wrAdd}} and \code{\link{WSlit}} for related functionality. diff --git a/tests/testthat/testthat_FSAUtils.R b/tests/testthat/testthat_FSAUtils.R index 938e0eff..733faec1 100644 --- a/tests/testthat/testthat_FSAUtils.R +++ b/tests/testthat/testthat_FSAUtils.R @@ -31,8 +31,8 @@ test_that("fact2num() messages",{ }) test_that("filterD() messages",{ - expect_error(filterD(0:5)) - expect_error(filterD(matrix(0:5,ncol=2))) + expect_error(filterD(0:5),"no applicable method") + expect_error(filterD(matrix(0:5,ncol=2)),"no applicable method") expect_warning(filterD(iris,Species=="DEREK"),"resultant data.frame") }) @@ -501,8 +501,8 @@ test_that("headtail() return values",{ expect_true(is.null(rownames(tmp))) ## check how it handles tbl_df object - if (require(dplyr)) { - iris2 <- dplyr::tbl_df(iris) + if (require(tibble)) { + iris2 <- tibble::as_tibble(iris) tmp <- FSA::headtail(iris2,n=15) expect_is(tmp,"data.frame") } @@ -543,8 +543,8 @@ test_that("peek() return values",{ expect_true(is.null(rownames(tmp))) ## check how it handles tbl_df object - if (require(dplyr)) { - iris2 <- dplyr::tbl_df(iris) + if (require(tibble)) { + iris2 <- tibble::as_tibble(iris) tmp <- FSA::peek(iris2,n=15) expect_is(tmp,"data.frame") } diff --git a/tests/testthat/testthat_nlsTracePlot.R b/tests/testthat/testthat_nlsTracePlot.R index 28e55823..7ff3e7d9 100644 --- a/tests/testthat/testthat_nlsTracePlot.R +++ b/tests/testthat/testthat_nlsTracePlot.R @@ -23,7 +23,7 @@ test_that("nlsTracePlot() test output",{ tmp <- nlsTracePlot(fit1,vb1,add=FALSE) expect_is(tmp,"matrix") expect_equal(mode(tmp),"numeric") - expect_equal(ncol(tmp),4) + expect_equal(ncol(tmp),3) # unsuccessful fit if (require(FSAdata)) { data(BSkateGB,package="FSAdata") @@ -37,7 +37,7 @@ test_that("nlsTracePlot() test output",{ tmp <- nlsTracePlot(trc,bh1,add=FALSE) expect_is(tmp,"matrix") expect_equal(mode(tmp),"numeric") - expect_equal(ncol(tmp),3) + expect_equal(ncol(tmp),2) } })