Learn R Programming

elfgen (version 2.3.4)

elfdata_vahydro: Retrieve data from DEQ VAHydro database and format data for ELF generation. Contact Virginia DEQ Office of Water Supply to request access to the VAHydro database.

Description

Given a set of VAHydro input parameters, outputs a dataframe of flow metric and richness metric data for hydrologic unit supplied

Usage

elfdata_vahydro(
  watershed.code,
  watershed.bundle,
  watershed.ftype,
  x.metric,
  y.metric,
  y.sampres,
  datasite,
  EDAS.localpath = tempdir()
)

Value

A dataframe of sites containing species richness data (NT Total values) and mean annual flow (MAF) data.

Arguments

watershed.code

Hydrologic unit code, either HUC6, HUC8, HUC10, or HUC12 (e.g. HUC10 code '0208020101').

watershed.bundle

dH bundle of hydrologic unit

watershed.ftype

dH ftype of hydrologic unit

x.metric

x-metric, i.e. streamflow or drainage area

y.metric

y-metric, most commonly species richness

y.sampres

Sample resolution of y.metric (e.g. 'species')

datasite

VAHydro database URL

EDAS.localpath

Local file path for storing downloaded EDAS data. Defaults to a temp directory.

Examples

Run this code
# \donttest{
# We don't run this example by R CMD check, because it takes >10s

# Retrieve dataset of interest
watershed.df <- elfdata_vahydro(
   'nhd_huc8_02080201',
   'watershed',
   'nhd_huc8',
   'nhdp_drainage_sqmi',
   'aqbio_nt_total',
   'species'
   )
elfdata_vahydro(watershed.df)
# }

Run the code above in your browser using DataLab