getTogetherCovarData: getTogetherCovarData

View source: R/getTogetherCovarData.r

getTogetherCovarDataR Documentation

getTogetherCovarData

Description

Put together available covariate data from both the external Environmental Covariate Database, as well as CAMP-collected environmental variables.

Usage

getTogetherCovarData(obs.eff.df, min.date, max.date, traps, enhmodel)

Arguments

obs.eff.df

A data frame with at least variables batchDate and efficiency, where efficiency is NA for all days requiring an estimate.

min.date

The start date for data to include. This is a text string in the format %Y-%m-%d, or YYYY-MM-DD.

max.date

The end date for data to include. Same format as min.date.

traps

A set of traps for which efficiency data are available.

enhmodel

A logical indicating if function getTogetherCovarData should use query dates based on provided min.date and max.date (TRUE), or efficency time frames (FALSE).

Details

Function getTogetherCovarData appends covariate information for each unique batchDate and TrapPositionID combination avaiable in data frame obs.eff.df.

Environmental covariate data are queried from the WEST-supported database created for housing USGS and CDEC data at sites important to the CAMP program.

Other covariates derive directly from data stored within a particular river's CAMP mdb database. Prior to use in efficiency models, data are first converted to standardized units via the QryCleanEnvCov SQL query sequence in function getCAMPEnvCov, which is called once for each covariate.

Following querying, all covariates are then fit with a smoothing spline via function estCovar, with penalization parameter λ selected via cross-validation. Smoothing occurs to ensure easy fitting of efficiency models, whose temporal resolution is that of a batchDate.

Value

Several items, all housed within a list. The main piece of output is data frame obs.eff.df, which contains the same number of rows as the obs.eff.df submitted to the function, but with several additional columns, due to appended covariates.

obs.eff.df

Same as submitted to the function, but with covariate columns added.

dbDisc

Available CAMP discharge data.

dbDpcm

Available CAMP water-depth data.

dbATpF

Available CAMP air-temperature data.

dbTurb

Available CAMP turbidity data.

dbWVel

Available CAMP water-velocity data.

dbWTpC

Available CAMP water-temperature data.

dbLite

Available CAMP light-penetration discharge data.

dbFlPG

Available Environmental Covariate Database discharge data.

dbTpPG

Available Environemtnal Covariate Database water temperature data.

References

Hastie, T., Tibshirani, R., and Friedman, J. 2009. The Elements of Statistical Learning. 2nd Edition. Springer, New York, New York.

See Also

getCAMPEnvCov, estCovar

Examples

 
## Not run: 
ans <- getTogetherCovarData(obs.eff.df,
                            min.date,
                            max.date,
                            traps,
                            enhmodel)

## End(Not run)

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