cdec_query: Query observation data

View source: R/query.R

cdec_queryR Documentation

Query observation data

Description

Function queries the CDEC site to obtain desired station data based on station, sensor number, duration code and start/end date. Use 'cdec_datasets()' to view an updated list of all available data at a station.

Usage

cdec_query(
  station,
  sensor_num,
  dur_code,
  start_date = NULL,
  end_date = NULL,
  tzone = "America/Los_Angeles"
)

Arguments

station

three letter identification for CDEC location (example "KWK", "SAC", "CCR")

sensor_num

sensor number for the measure of interest. (example "20", "01", "25")

dur_code

duration code for measure interval, "E", "H", "D", which correspong to Event, Hourly and Daily.

start_date

date to start the query on.

end_date

an optional date to end query on, defaults to current date.

tzone

a time zone used. By default this is America/Los_Angeles, this accounts for daylight saving.

Value

data frame containing queried data from CDEC for a specific station, sensor, and date range

Examples

## Not run: 
kwk_hourly_flows <- CDECRetrieve::cdec_query("KWK", "20", "H", "2017-01-01")
ccr_hourly_temps <- CDECRetrieve::cdec_query("CCR", "25", "H", Sys.Date())

## End(Not run)

FlowWest/CDECRetrieve documentation built on Oct. 10, 2022, 9:31 p.m.