powered by
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.
cdec_query( station, sensor_num, dur_code, start_date = NULL, end_date = NULL, tzone = "America/Los_Angeles" )
three letter identification for CDEC location (example "KWK", "SAC", "CCR")
sensor number for the measure of interest. (example "20", "01", "25")
duration code for measure interval, "E", "H", "D", which correspong to Event, Hourly and Daily.
date to start the query on.
an optional date to end query on, defaults to current date.
a time zone used. By default this is America/Los_Angeles, this accounts for daylight saving.
data frame containing queried data from CDEC for a specific station, sensor, and date range
# 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()) # }
Run the code above in your browser using DataLab