From 6d6483dbe7aa22146e13bbfb36c911e7c2bea30d Mon Sep 17 00:00:00 2001 From: Chantel Wetzel Date: Wed, 27 Jun 2018 13:43:14 -0700 Subject: [PATCH] Package documentation --- NAMESPACE | 1 - man/DesignBasedEstBiomass.EWC.fn.Rd | 4 +++- man/SS3AF.fn.Rd | 13 +++++++++++- man/SS3AgeAtLen.fn.Rd | 8 ++++++-- man/SS3LF.fn.Rd | 4 +++- man/getN.Rd | 2 +- man/plotBio.fn.Rd | 10 ++++++---- man/plotBioStrata.fn.Rd | 31 +++++++++++++++++++---------- man/plotFreqDataStrata.fn.Rd | 4 +++- man/plotLFs.fn.Rd | 31 ----------------------------- man/plotSexRatio.fn.Rd | 13 +++++++++--- man/varLengthAtAge.fn.Rd | 13 +++++++++--- 12 files changed, 74 insertions(+), 60 deletions(-) delete mode 100644 man/plotLFs.fn.Rd diff --git a/NAMESPACE b/NAMESPACE index 550a1bc..95ba202 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -26,7 +26,6 @@ export(plotBio.fn) export(plotBioStrata.fn) export(plotFreqData.fn) export(plotFreqDataStrata.fn) -export(plotLFs.fn) export(plotSexRatio.fn) export(readDataFromExcel.fn) export(readInAgeComps.fn) diff --git a/man/DesignBasedEstBiomass.EWC.fn.Rd b/man/DesignBasedEstBiomass.EWC.fn.Rd index acaaec5..2bad083 100644 --- a/man/DesignBasedEstBiomass.EWC.fn.Rd +++ b/man/DesignBasedEstBiomass.EWC.fn.Rd @@ -5,7 +5,7 @@ \title{Calculates design based estimates from survey data for early West Coast surveys (e.g., Triennial, AFSC slope)} \usage{ DesignBasedEstBiomass.EWC.fn(dir, dat, strat.vars = c("BOTTOM_DEPTH", - "START_LATITUDE"), strat.df, printfolder = "forSS") + "START_LATITUDE"), strat.df, printfolder = "forSS", outputMedian = TRUE) } \arguments{ \item{dir}{directory of the excel file} @@ -16,6 +16,8 @@ DesignBasedEstBiomass.EWC.fn(dir, dat, strat.vars = c("BOTTOM_DEPTH", \item{printfolder}{the folder where files will be saved} +\item{outputMedian}{T/F output median or the mean biomass estimate} + \item{stat.vars}{A vector of the strata variable names (i.e., c("BEST_LATITUDE","BEST_DEPTH"))} } \description{ diff --git a/man/SS3AF.fn.Rd b/man/SS3AF.fn.Rd index bceb8c0..3a9ff16 100644 --- a/man/SS3AF.fn.Rd +++ b/man/SS3AF.fn.Rd @@ -4,13 +4,24 @@ \alias{SS3AF.fn} \title{Wrapper function to create age frequency data in format for Stock Synthesis} \usage{ -SS3AF.fn(Age.df, ageBins, ...) +SS3AF.fn(dir, Age.df, ageBins, agelow = -1, agehigh = -1, ageErr = "NA", + printfolder = "forSS", ...) } \arguments{ +\item{dir}{directory to save the file} + \item{Age.df}{age data frame} \item{ageBins}{defined age bins} +\item{agelow}{SS value} + +\item{agehigh}{SS value} + +\item{ageErr}{age error vector value} + +\item{printfolder}{folder where the length comps will be saved} + \item{...}{additional inputs} } \description{ diff --git a/man/SS3AgeAtLen.fn.Rd b/man/SS3AgeAtLen.fn.Rd index f83e1f2..15a6cc0 100644 --- a/man/SS3AgeAtLen.fn.Rd +++ b/man/SS3AgeAtLen.fn.Rd @@ -11,11 +11,13 @@ Gender=2: males only. Female values ignored. lgthBins is either the interval between length bins or the actual length bins note that 0 and Inf are tacked on the ends to account for lengths and ages outside the interval. You may want to add these in to first and last bin.} \usage{ -SS3AgeAtLen.fn(ages, lgthBins = 1, ageBins = 1, fleet = "EnterFleet", +SS3AgeAtLen.fn(dir, ages, lgthBins = 1, ageBins = 1, fleet = "EnterFleet", season = 1, partition = 0, ageerr = "EnterAgeErr", raw = T, - sexRatioUnsexed = NA, maxSizeUnsexed = NA) + sexRatioUnsexed = NA, maxSizeUnsexed = NA, printfolder = "forSS") } \arguments{ +\item{dir}{directory this is where the output files will be saved} + \item{ages}{object} \item{lgthBins}{Either the interval between length bins or the actual length bins (e.g., lgthBins = 11:47)} @@ -35,6 +37,8 @@ SS3AgeAtLen.fn(ages, lgthBins = 1, ageBins = 1, fleet = "EnterFleet", \item{sexRatioUnsexed}{replace the sex ratio with set value} \item{maxSizeUnsexed}{maximum size to use the sexRatioUnsexed value} + +\item{printfolder}{folder where the length comps will be saved} } \description{ Calculates proportion of age at length and reformats into SS3 format diff --git a/man/SS3LF.fn.Rd b/man/SS3LF.fn.Rd index 1cd7869..5197f73 100644 --- a/man/SS3LF.fn.Rd +++ b/man/SS3LF.fn.Rd @@ -24,12 +24,14 @@ sexRatioUnsexed is the proportion used to assign unsexed fish to females -- if it is NA, unsexed fish are omitted WHEN GENDER=3 (THIS IS THE DEFAULT) maxSizeUnsexed determines the maximum size at which the sexRatioUnsexed is applied. If sexRatioUnsexed is a vector, this is ignored} \usage{ -SS3LF.fn(len, lgthBins = 1, gender = 3, nSamps = "EnterNsamps", +SS3LF.fn(dir, len, lgthBins = 1, gender = 3, nSamps = "EnterNsamps", fleet = "EnterFleet", season = 1, partition = 0, NAs2zero = T, sexRatioUnsexed = NA, maxSizeUnsexed = NA, printfolder = "forSS", remove999 = TRUE) } \arguments{ +\item{dir}{directory to save the file} + \item{len}{object} \item{lgthBins}{Either the interval between length bins or the actual length bins (e.g., lgthBins = 11:47)} diff --git a/man/getN.Rd b/man/getN.Rd index 0686b8d..4c4fc22 100644 --- a/man/getN.Rd +++ b/man/getN.Rd @@ -15,7 +15,7 @@ getN(dir, dat, type, survey, headerRow = "default", species = "flatfish", \item{type}{specify whether doing "length" or "age". Used to read associatied excel sheets} -\item{survey}{survey name, options = c("NWFSC", "Tri.Shelf", "AFSC.Slope")} +\item{survey}{survey name, options = c("NWFSCBT", "Tri.Shelf", "AFSC.Slope")} \item{headerRow}{line of header row in excel file} diff --git a/man/plotBio.fn.Rd b/man/plotBio.fn.Rd index 1934de3..a688e50 100644 --- a/man/plotBio.fn.Rd +++ b/man/plotBio.fn.Rd @@ -4,14 +4,16 @@ \alias{plotBio.fn} \title{Plots the biomass with confidence intervals} \usage{ -plotBio.fn(dir, bio, CI = 0.95, scalar = 1e+06, gap = 0.03, - ylab = "Biomass ('000 mt)", xlab = "Year", main = NULL, ylim = NULL, - add = FALSE, col = "black", dopng = FALSE, ...) +plotBio.fn(dir, dat, survey = "NWFSCBT", CI = 0.95, scalar = 1e+06, + gap = 0.03, ylab = "Biomass ('000 mt)", xlab = "Year", main = NULL, + ylim = NULL, add = FALSE, col = "black", dopng = FALSE, ...) } \arguments{ \item{dir}{directory to save the file} -\item{bio}{object created by the GetTotalBiomass.fn} +\item{dat}{object created by the GetTotalBiomass.fn} + +\item{survey}{specify the survey data set for calculations. Options are "NWFSCBT", "Tri.Shelf", "AFSC.Slope"} \item{CI}{confidence interval} diff --git a/man/plotBioStrata.fn.Rd b/man/plotBioStrata.fn.Rd index cf6a607..8b33950 100644 --- a/man/plotBioStrata.fn.Rd +++ b/man/plotBioStrata.fn.Rd @@ -2,15 +2,18 @@ % Please edit documentation in R/plotBioStrata.fn.R \name{plotBioStrata.fn} \alias{plotBioStrata.fn} -\title{Not recommended for use yet -Name would imply that it would plot by strata but that is currently not happening -Duplicate to the plotBio.fn but not as polished} +\title{Plot the design based estimated biomass by strata and year +Currently only works with the triennial or afsc survey data +This is a new function and the results should be scrutinized} \usage{ -plotBioStrata.fn(bio, CI = 0.95, scalar = 1e+06, gap = 0.03, - ylab = "Biomass ('000 mt)", xlab = "Stratum", ylim = NULL, ...) +plotBioStrata.fn(dir, dat, CI = 0.95, scalar = 1e+06, gap = 0.01, + legloc = "topright", single = TRUE, ylab = "Biomass ('000 mt)", + xlab = "Year", yliminput = NULL, dopng = FALSE, ...) } \arguments{ -\item{bio}{object created by the GetTotalBiomass.fn} +\item{dir}{directory to save the file} + +\item{dat}{object created by the GetTotalBiomass.fn} \item{CI}{confidence interval} @@ -18,17 +21,23 @@ plotBioStrata.fn(bio, CI = 0.95, scalar = 1e+06, gap = 0.03, \item{gap}{a value that introduces a slight gap between the point estimate and the start of the line for the CI. A gap too large will invert the CI, making it look huge. You should know when this happens} +\item{legloc}{location to put legend in the single panel plot} + +\item{single}{TRUE/FALSE true plots each stratum on the same figure} + \item{ylab}{y-axis text label} \item{xlab}{x-axis text label} -\item{ylim}{y-limits} +\item{yliminput}{user defined y-limits} + +\item{dopng}{TRUE/FALSE whether to save a png file} } \description{ -Not recommended for use yet -Name would imply that it would plot by strata but that is currently not happening -Duplicate to the plotBio.fn but not as polished +Plot the design based estimated biomass by strata and year +Currently only works with the triennial or afsc survey data +This is a new function and the results should be scrutinized } \author{ -Allan Hicks +Allan Hicks and Chantel Wetzel } diff --git a/man/plotFreqDataStrata.fn.Rd b/man/plotFreqDataStrata.fn.Rd index 189f9ba..0f4371e 100644 --- a/man/plotFreqDataStrata.fn.Rd +++ b/man/plotFreqDataStrata.fn.Rd @@ -2,7 +2,8 @@ % Please edit documentation in R/plotFreqDataStrata.fn.R \name{plotFreqDataStrata.fn} \alias{plotFreqDataStrata.fn} -\title{This function plots frequency data as bubble plots when strata instead of years are used +\title{I have not tested this function to make sure it works correctly: Chantel Wetzel +This function plots frequency data as bubble plots when strata instead of years are used You may want to change all zeros to NA's so that those observations are not plotted. If you don't then set zero2NAs=F} \usage{ @@ -21,6 +22,7 @@ plotFreqDataStrata.fn(dat, inch = 0.15, ylab = "Bins", xlab = "", \item{zero2NAs}{T/F change 0 values to NA} } \description{ +I have not tested this function to make sure it works correctly: Chantel Wetzel This function plots frequency data as bubble plots when strata instead of years are used You may want to change all zeros to NA's so that those observations are not plotted. If you don't then set zero2NAs=F diff --git a/man/plotLFs.fn.Rd b/man/plotLFs.fn.Rd deleted file mode 100644 index 560d6a6..0000000 --- a/man/plotLFs.fn.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/plotLFs.fn.R -\name{plotLFs.fn} -\alias{plotLFs.fn} -\title{A wrapper for the plotFreqData -because I originally called it plotLFs.fn and want to keep it compatible with already written analyses} -\usage{ -plotLFs.fn(dat, inch = 0.15, ylab = "Bins", xlab = "Year", zero2NAs = T, - ...) -} -\arguments{ -\item{dat}{object created by SS3LF.fn or SS3AF.fn} - -\item{inch}{input to the symbols plot: TRUE, FALSE or a positive number.} - -\item{ylab}{y-axis text label} - -\item{xlab}{x-axis text label} - -\item{zero2NAs}{T/F change 0 values to NA} -} -\description{ -A wrapper for the plotFreqData -because I originally called it plotLFs.fn and want to keep it compatible with already written analyses -} -\seealso{ -\code{\link{plotFreqData.fn}} -} -\author{ -Allan Hicks -} diff --git a/man/plotSexRatio.fn.Rd b/man/plotSexRatio.fn.Rd index fb26dbc..1a9f44b 100644 --- a/man/plotSexRatio.fn.Rd +++ b/man/plotSexRatio.fn.Rd @@ -4,18 +4,25 @@ \alias{plotSexRatio.fn} \title{Function to plot sex ratio} \usage{ -plotSexRatio.fn(len, fn = median, circleSize = 0.1, ...) +plotSexRatio.fn(dir, dat, fn = median, survey, circleSize = 0.1, + dopng = FALSE, ...) } \arguments{ -\item{len}{data object} +\item{dir}{directory location for saving the png} + +\item{dat}{data object} \item{fn}{value to calculate from the data (e.g., median, mean)} +\item{survey}{specify the survey data set for calculations. Options are "NWFSCBT", "Tri.Shelf", "AFSC.Slope"} + \item{circleSize}{circle size} + +\item{dopng}{TRUE/FALSE whether to save a png file} } \description{ Function to plot sex ratio } \author{ -Allan Hicks +Allan Hicks and Chantel Wetzel } diff --git a/man/varLengthAtAge.fn.Rd b/man/varLengthAtAge.fn.Rd index 0058508..dfc931d 100644 --- a/man/varLengthAtAge.fn.Rd +++ b/man/varLengthAtAge.fn.Rd @@ -4,12 +4,17 @@ \alias{varLengthAtAge.fn} \title{Plot variability of length at age} \usage{ -varLengthAtAge.fn(dat, ageBin = 1, bySex = T, parStart = c(52, 0.09, 1), - estVB = T, bins = NULL, legX = "bottomleft", legY = NULL, ...) +varLengthAtAge.fn(dir, dat, survey, ageBin = 1, bySex = T, + parStart = c(52, 0.09, 1), estVB = T, bins = NULL, + legX = "bottomleft", legY = NULL, dopng = FALSE, ...) } \arguments{ +\item{dir}{directory to save the file} + \item{dat}{The data loaded from the NWFSC database or the SexedLgthWtAge sheet} +\item{survey}{specify the survey data set for calculations. Options are "NWFSCBT", "Tri.Shelf", "AFSC.Slope"} + \item{ageBin}{Currently fixed at 1, so a moot parameter} \item{bySex}{Logical to indicate if plot by sex} @@ -21,6 +26,8 @@ it uses the paramters in \code{parStart}.} \item{bins}{The bins to put ages into. If NULL then simply uses the ages as recorded.} +\item{dopng}{TRUE/FALSE whether to save a png file} + \item{...}{Additional arguments for the plots} } \description{ @@ -35,5 +42,5 @@ Plots the SD and CV of age at observed and predicted length res <- varLengthAtAge.fn(slwa,ageBin=1,bySex=T,parStart=c(52,0.09,1),estVB=T) } \author{ -Allan Hicks +Allan Hicks and Chantel Wetzel }