DWEFprep: Prepare the Deepwater Electrofishing Data

View source: R/DWEFprep.R

DWEFprepR Documentation

Prepare the Deepwater Electrofishing Data

Description

Read in the deepwater electofishing data (including information on the lamprey catch, the lamprey lengths, and the identification of plots that were treated) and prepare them for estimation.

Usage

DWEFprep(
  Dir,
  CatchFile,
  LengthsFile,
  PlotsFile,
  TRTtiming = "AFTER",
  CatchHist,
  LengthHist,
  PlotHist,
  PEHist,
  b4plots = NULL
)

Arguments

Dir

A character scalar identifying the path where the data files are stored. Use forward slashes, e.g., Dir = "C:/temp/mydir".

CatchFile

A character scalar identifying the name of the *.xl* file with catch data. The file should have at least the following 19 columns, named in the header row: SAMPID, LATITUDE, LONGITUDE, STIME, BOAT, SAMPLE, DEPTH, SUB_MAJOR, SUB_MINOR1, SUB_MINOR2, GPSDATE, HAB_TYPE, SL_TOTAL, AB_TOTAL, I_TOTAL, COMMENT, NEW_NUMB, INBPLOT, REGION (these last 3 columns are added in using ArcInfo). See details.

LengthsFile

A character vector identifying the names of the *.xl* files with the lengths data. The files should have at least the following 2 columns, named in the header row: SAMPID, LENGTH. See details.

PlotsFile

A character vector identifying the name of the *.xl* file with the treatment plots data. The files should have at least the following 3 columns, named in the header row: AREA, Plot_09, Treat_YYYY, where YYYY is the current year. Treat_YYYY is equal to 1 if the plot was treated that year, equal to 0 otherwise. If a plot was treated twice in one year, it will be listed on two separate rows, each with Treat_YYYY=1. See details.

TRTtiming

A character scalar identifying the timing of the assessment survey relative to treatment. "AFTER" if all plots were surveyed AFTER they were treated (the default), "BEFORE" if all plots were survey BEFORE they were treated, "NONE" if no plots were treated, and "MIXED" if some plots were surveyed before and some plots were surveyed after treatment.

CatchHist

A character scalar identifying the name of the *.csv file with historic catch data. The file should have these 29 columns, named in the header row: year, mm, dd, stime, period, sampid, transamp, transect, site, boat, latitude, longitude, region, label, inbplot, plot.num, new.numb, sample, cluster, depth, hab.type, sub.major, sub.minor1, sub.minor2, ab.total, i.total, sl.larv.n, sl.larv.adj, comment.

LengthHist

A character scalar identifying the name of the *.csv file with historic lengths data. The file should have these 4 columns, named in the header row: year, sampid, length, sl.larv.adj.

PlotHist

A character scalar identifying the name of the *.csv file with historic plot-specific estimates. The file should have these 15 columns, named in the header row: year, period, new.numb, meanlat, meanlong, area.ha, n.samp, catch, meannperha, sd.dens, larvpe, ptran, tranpe, pbig, bigpe.

PEHist

A character scalar identifying the name of the *.csv file with historic whole-river population estimates. The file should have these 14 columns, named in the header row: Year, Design, Type, Period, Trt, Dates, Samples, Catch, Area_ha, PE, SD, LO, HI, CV.

b4plots

A numeric vector identifying the plots that were surveyed BEFORE they were treated. A value for this should only be provided if TRTtiming is set to "MIXED" (default NULL).

Details

The order of the columns and the case of the column names in the CatchFile, LengthsFile, PlotsFile files are unimportant. Additional columns may be also be part of theses files, but they will be ignored.

Value

A list with DWEF catch, length, and plot data in three data frames (CAT, LEN, PLT) and a character vector of the SOURCE directory and file names. The plot data is reorganized to have only one row per plot, with the trtd variable indicating the number of treatments each plot received that year.


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