AIpresto: Adult Index Preparation, Error Checking, and Estimation

View source: R/AIpresto.R

AIprestoR Documentation

Adult Index Preparation, Error Checking, and Estimation

Description

Carry out a series of steps in the Adult Index estimation process in one fell swoop. This function prepares and error checks the data, estimates the Adult Index, calculates the targets, and generates a draft report.

Usage

AIpresto(DIRECTORY, NEWDATARAW, STREAMDATAPREV, LAKEDATAPREV)

Arguments

DIRECTORY

A character scalar identifying the path where the csv files are stored, e.g., DIRECTORY = "C:\\temp\\mydir".

NEWDATARAW

A character scalar identifying the name of the csv file with stream mark-recapture estimates for which Adult Indices will be estimated (typically from the current year). The first row of the csv file should be column headers and must include: year, lake, population estimate PEmr, coefficient of variation CVmr (100% * sqrt(variance(PEmr)) / PEmr).

STREAMDATAPREV

A character scalar identifying the name of the csv file with stream mark-recapture estimates for which Adult Indices have already been estimated (typically from previous years), with the same variables as in NEWDATARAW plus the previously estimated contribution indexContrib and indexContribCV.

LAKEDATAPREV

A character scalar identifying the name of the csv file with annual lake-wide Adult Index estimates (typically from previous years), with 5 columns: lake, year, index, and the lower and upper 95% confidence intervals ilo and ihi.

Details

For more details on the entire process and the steps involved, see the vignette Adult Index Estimation.

Value

Four data summaries are saved as csv files to DIRECTORY, where YYYY represents the most recent year of data in NEWDATARAW:

  • AdultStreamYYYY.csv - an updated version of NEWDATARAW with the additional column of the lake-stream IDs, lscode, which are combination of lake ID and stream ID, e.g., 1.064 = lake ID 1 + (stream ID 64)/1000

  • AdultStreamThruYYYY.csv - an updated version of STREAMDATAPREV with the latest year of data added

  • AdultLakeThruYYYY.csv - an updated version of LAKEDATAPREV with the latest year of data added

  • AdultTargetYYYY.csv - the calculated targets for the Adult Index of each Great Lake, with 2 columns: lake and targInd

Two rich text documents are saved as doc files (so that MS Word will open them automatically) to DIRECTORY:

  • YYYY Adult Index - error checking.doc - error checking document

  • YYYY Adult Index - draft report.doc - draft report document

See Also

AIprep, AIcheck, AIestimate, AItarget, AIreport

Examples

## Not run: 
 library(GLFC)
 AIpresto(
   DIRECTORY = "C:\\TrappingData\\2015",
   NEWDATARAW = "TrapCatchEstimate2015.csv",
   STREAMDATAPREV = "AdultStreamThru2014.csv",
   LAKEDATAPREV = "AdultLakeThru2014.csv")

## End(Not run)

JVAdams/GLFC documentation built on Jan. 5, 2023, 12:59 a.m.