query_stations: Query ODEQ's Stations database.

View source: R/query_stations.R

query_stationsR Documentation

Query ODEQ's Stations database.

Description

Retrieve station information from ODEQ's Stations database based on a set of query paramaters. If no query parameters are supplied to the function the entire stations database will be returned. This function will only work for employees of ODEQ. Requires read access permissions for internal odbc connections to the AWQMS and Stations databases.

Usage

query_stations(
  stations_odbc = "STATIONS",
  mlocs = NULL,
  huc8_name = NULL,
  huc10_name = NULL,
  huc12_name = NULL,
  huc8 = NULL,
  huc10 = NULL,
  huc12 = NULL,
  au_id = NULL,
  gnis_name = NULL,
  reachcode = NULL,
  owrd_basin = NULL,
  state = c("OR", "ID", "CA", "WA", "NV", "PACIFIC OCEAN")
)

Arguments

stations_odbc

Stations database ODBC system data source name (DSN) identifed in the ODBC data sources administrator. Default is "STATIONS".

mlocs

Vector of unique monitoring location station IDs (MLocIDs).

huc8_name

Vector of unique huc8 names.

huc10_name

Vector of unique huc10 names.

huc12_name

Vector of unique huc12 names.

huc8

Vector of unique huc8 codes.

huc10

Vector of unique huc10 codes.

huc12

Vector of unique huc12 codes.

au_id

Vector of unique assessment unit IDs.

gnis_name

Vector of unique NHD GNIS names.

reachcode

Vector of unique NHD reachcodes.

owrd_basin

Vector of unique OWRD administrative Basins.

state

Vector of unique two letter state codes. Defaults to c("OR", "ID", CA", "WA", "NV", "PACIFIC OCEAN")

Value

Dataframe from the stations database

Examples

library(AWQMSdata)

# Retreive AWQMS data
df.awqms <- AWQMSdata::AWQMS_Data(startdate = "1995-01-01",
                                  enddate = "2019-12-31",
                                  char = "Temperature, water",
                                  HUC10 = "1801020604",
                                  crit_codes = TRUE,
                                  filterQC = TRUE)

df.stations <- query_stations(mlocs=unique(df.awqms$MLocID),
                             stations_odbc = "STATIONS")

TravisPritchardODEQ/AWQMSdata documentation built on Nov. 10, 2024, 8:26 a.m.