PacFIN_Example: Sample PacFIN Run

Description Details Getting Started Stratification Expansions Length Comps Ages Age-at-Length Close the file recording your session

Description

Cut and paste each of the following commands in turn to see the workflow for processing PacFIN data.

Details

The data files for species "XMPL" are supplied with this package, and can be used to explore the options of the various functions.

Getting Started

The "sink" command will save a record of your session for review.

sink(file = "~/Example.txt", split=T)

dim(XMPL.BDS)

dim(Catch.XMPL)

Pdata = cleanPacFIN(XMPL.BDS)

Stratification

table(Pdata$geargroup)

Pdata$mygear = Pdata$geargroup

Pdata$mygear[ Pdata$mygear != c("HKL")] = "TWL"

Pdata$stratification = paste(Pdata$state,Pdata$mygear, sep=".")

table(Pdata$stratification)

head(Catch.XMPL)

Expansions

Pdata = getExpansion_1(Pdata)

Pdata = getExpansion_2(Pdata, Catch.XMPL, Convert=T)

Pdata$Final_Sample_Size = Pdata$Expansion_Factor_1 * Pdata$Expansion_Factor_2

Length Comps

Lcomps = getComps(Pdata, Comps="LEN")

Lcomps = doSexRatio(Lcomps)

writeComps(Lcomps, fname = "~/LenComps.csv")

Ages

Adata = cleanAges(Pdata)

Adata = getExpantion_1(Adata)

Adata = getExpansion_2(Adata, Catch.XMPL, Convert=T)

Adata$Final_Sample_Size = Adata$Expansion_Factor_1 * Adata$Expansion_Factor_2

Acomps = getComps(Adata, Comps="AGE")

Acomps = doSexRatio(Acomps)

writeComps(Acomps, fname= "~/Age.comps.csv")

Age-at-Length

Adata$Final_Sample_Size = 1

ALcomps = getComps(Adata, Comps="AAL")

ALcomps = doSexRatio(ALcomps)

writeComps(ALcomps, fname = "~/AAL.Comps.csv")

Close the file recording your session

sink()


nwfsc-assess/PacFIN.Utilities documentation built on June 30, 2017, 8:49 a.m.