R/PacFIN_Example.R

########################################################################
#' Sample PacFIN Run
#' 
#' Cut and paste each of the following commands in turn to
#' see the workflow for processing PacFIN data.
#' 
#' The data files for species "XMPL" are supplied with this
#' package, and can be used to explore the options of 
#' the various functions.
#' 
#' @section Getting Started:
#' 
#' The "sink" command will save a record of your session for review.
#' 
#' 
#'  \code{sink(file = "~/Example.txt", split=T)}
#' 
#'  \code{dim(XMPL.BDS)}
#' 
#'  \code{dim(Catch.XMPL)}
#' 
#'  \code{Pdata = cleanPacFIN(XMPL.BDS)}
#' 
#' @section Stratification:
#' 
#'  \code{table(Pdata$geargroup)}
#' 
#'  \code{Pdata$mygear = Pdata$geargroup}
#' 
#'  \code{Pdata$mygear[ Pdata$mygear != c("HKL")] = "TWL"}
#' 
#'  \code{Pdata$stratification = paste(Pdata$state,Pdata$mygear, sep=".")}
#' 
#'  \code{table(Pdata$stratification)}
#' 
#'  \code{head(Catch.XMPL)}
#' 
#' @section Expansions:
#' 
#'  \code{Pdata = getExpansion_1(Pdata)}
#' 
#'  \code{Pdata = getExpansion_2(Pdata, Catch.XMPL, Convert=T)}
#' 
#'  \code{Pdata$Final_Sample_Size = Pdata$Expansion_Factor_1 * Pdata$Expansion_Factor_2}
#' 
#' @section Length Comps:
#' 
#'  \code{Lcomps = getComps(Pdata, Comps="LEN")}
#' 
#'  \code{Lcomps = doSexRatio(Lcomps)}
#' 
#'  \code{writeComps(Lcomps, fname = "~/LenComps.csv")}
#' 
#' @section Ages:
#' 
#'  \code{Adata = cleanAges(Pdata)}
#' 
#'  \code{Adata = getExpantion_1(Adata)}
#' 
#'  \code{Adata = getExpansion_2(Adata, Catch.XMPL, Convert=T)}
#' 
#'  \code{Adata$Final_Sample_Size = Adata$Expansion_Factor_1 * Adata$Expansion_Factor_2}
#' 
#'  \code{Acomps = getComps(Adata, Comps="AGE")}
#' 
#'  \code{Acomps = doSexRatio(Acomps)}
#' 
#'  \code{writeComps(Acomps, fname= "~/Age.comps.csv")}
#' 
#' @section Age-at-Length:
#' 
#'  \code{Adata$Final_Sample_Size = 1}
#' 
#'  \code{ALcomps = getComps(Adata, Comps="AAL")}
#' 
#'  \code{ALcomps = doSexRatio(ALcomps)}
#' 
#'  \code{writeComps(ALcomps, fname = "~/AAL.Comps.csv")}
#' 
#' @section Close the file recording your session:
#' 
#'  \code{sink()}
#' 
#' @name PacFIN_Example
#' @docType package
#'
NULL
nwfsc-assess/PacFIN.Utilities documentation built on Jan. 3, 2020, 10:28 p.m.