prepOneStrata: This function takes data as a dataframe with one row per...

Description Usage Arguments

View source: R/prepOneStrata.R

Description

This function is called by prepStrata. This function may be of use to you in writing your own wrapper, or performing a specific analysis, but generally users should use prepStrata to prepare their data for estimStrataMCpbt.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
prepOneStrata(
  trapData,
  tags,
  GSIcol,
  PBTcol,
  variableCols = c(),
  variableColsOth = c(),
  adFinCol,
  AI = TRUE,
  verbose = TRUE,
  GSIgroups = NA,
  variableValues = NA,
  variableValuesOth = NA,
  strataName = NA,
  symPrior = 0.5
)

Arguments

trapData

dataframe with data for fish sampled from one strata - trap data for dam escapement

tags

dataframe with tag rates for all groups. This should NOT include the Unassigned group.

GSIcol

name of column containing GSI assignments. If you have no GSI information, create a column with the same value for all samples.

PBTcol

name of column containing PBT assignments

variableCols

vector of column names of columns containing the variables to estimate composition and to inform the group selection for PBT untagged fish

variableColsOth

vector of column names of columns containing the variables to estimate composition but NOT inform the group selection for PBT untagged fish

adFinCol

name of column containing adipose fin status - TRUE (or AI) being intact FALSE (or AD) being clipped, NA missing

AI

TRUE to analyse ad-intact fish, FALSE to analyze ad-clipped fish

verbose

TRUE to print some messages, FALSE to not

GSIgroups

These are the values for all the GSI groups that you expect to be present in the population. If NA, then the values are taken to be all the unique values in the GSI column in the dataset.

variableValues

a list, in the order of variableCols with entries having the values expected for each variable. This is helpful to make sure the same variable values are estiamted in each strata even if one value is not observed in all strata. If a value other than a list is given (for example, NA), it uses the values present in the dataset.

variableValuesOth

Same as variableValues, but for variableColsOth

symPrior

All the priors are Dirichlet distributions. The default is to use this value for all the alphas of all the priors. You can, and are encouraged to, manually adjust the priors as you see fit prior to running the MCMC chain.


delomast/fishCompTools documentation built on Jan. 11, 2021, 1:51 a.m.