View source: R/checkValidCovars.r
checkValidCovars | R Documentation |
Check a data frame of efficiency trials and covariates for a trap location for complete data.
checkValidCovars(df, tmp.df, min.date, max.date, covarB, site, strt.dt, end.dt)
df |
The data frame for a specific |
tmp.df |
The reduced data frame originating from |
min.date |
The start date for data to include. This is a text string in
the format |
max.date |
The end date for data to include. Same format as
|
covarB |
A character vector containing the covariates deemed important
in the enhanced efficiency model tied to the |
site |
The identification number of the site for which estimates are required. |
strt.dt |
The remapped start date associated with the current trap's minimum (earliest) spline date. |
end.dt |
The remapped end date associated with the current trap's maximum (latest) spline date. |
The values of min.date
and max.date
are the same as
those provided by the user in the initial passage estimation run.
Function checkValidCovars
first assesses the degree of presence of
each covariate (other than temporal spline basis vectors) required to run
that particular TrapPositionID
's enhanced efficiency model via
df
.
It performs three checks.
The first ensures that all covariates listed in covarB
are actually
present in data frame df
. A covariate could have been used for
enhanced efficiency fitting, but yet be missing in a particular year
requested for passage, if over ALL years on which the enhanced efficiency
estimation was fit, more than 90
covariate in question. This implies that, inevitably, one year could "take
the blame," and thus, prevent enhanced-efficiency estimation. This
behavior occurs on the Stanislaw in 1998 on subsiteID=1004
, where
covariate waterDepth_cm is missing for the majority of the e-trial year.
Thus, passage involving this year and trap utilized original spline-style
efficiency modeling.
The second assesses for presence, for each
batchDate
, with respect to the user-provided min.date
and
max.date
, which could be arbitrary, while the third assesses for
covariate presence within the batchDate
date range over which
efficiency trials took place within the provided min.date
and
max.date
.
All covariates tied to an enhanced-efficiency fit must at least be present
for all inclusive efficiency-trial batchDates
to fit the
TrapPositionID
's enhanced efficiency model.
A modified dataframe input of df
, containing possibly
filled-in values for NA
observed outside the temporal range of
efficiency trials returned from min.date
and max.date
.
## Not run: checkValidCovars(df,tmp.df,min.date,max.date,covarB,site) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.