reduceETrials: reduceETrials

View source: R/reduceETrials.r

reduceETrialsR Documentation

reduceETrials

Description

Map the set of efficiency trials to the 1959-1960 enhanced efficiency spline-fitting paradigm.

Usage

reduceETrials(df, possibleVars, bsplBegDt, bsplEndDt, trap, all.ind.inside)

Arguments

df

The data frame for a specific TrapPositionID containing efficiency-trial information and covariates, if available, at the time of fitting enhanced efficiency trials in eff_model.r (or F.efficiency.model ).

possibleVars

The set of all available variables for possible inclusion to the fitting of an enhanced efficiency model. Usually include efficiency-trial variables, environmental covariate variables, and CAMP-collected variables.

bsplBegDt

The first date, via the spline-1959-1960 paradigm, to which all efficiency years and dates collapse.

bsplEndDt

The last date, via the spline-1959-1960 paradigm, to which all efficiency years and dates collapse.

trap

A trap for which efficiency data are available.

all.ind.inside

A logical vector of length equal to the number of rows of data frame df, expressing which batchDates fall within the temporal data-range for which estimation occurs.

Details

Function reduceETrials does the work of mapping several years' worth of efficiency trials to one common temporal period. For convenience, the common temporal period is 1960. 1960 was select because it is a leap-year. It is also near the POSIX temporal original date of "1970-01-01". This is helpful in rare cases in which direct manipulation of POSIX items is necessary, since raw numerics associated with POSIX variables record the number of seconds since the origination date.

Sometimes, the spline year paradigm for a river may stretch back into 1959. It never stetches into 1961. This is important for use in function eff_model, where care must be taken to ensure that the resulting 1960-spline fit housed in previously fit enhanced efficiency data maps correctly to provided min.date and max.date, when provided for passage estimation. Lack of attention here could result in re-maps to the wrong min.date and max.date year.

Value

A list containing several items.

df

The original df with batchDate2 appended.

tmp.df

The set of efficiency trials for the TrapPositionID of interest.

m.i

The number of efficiency trials within the time period of interest.

initialVars

The set of possible covariates available prior to model fitting.

initialVarsNum

An accounting data frame helpful in creating data frame betas following model fitting.

all.ind.inside

A logical vector indicating which batchDates fell within the temporal range spanned by valid efficiency trials.

Examples

## Not run: 
ans <- reduceETrials(df,possibleVars,bsplBegDt,bsplEndDt,trap,all.ind.inside)

## End(Not run)

tmcd82070/CAMP_RST documentation built on April 6, 2022, 12:07 a.m.