FlowWest / CDECRetrieve

An R package to retrieve CDEC data
https://flowwest.github.io/CDECRetrieve/
Other
7 stars 5 forks source link

cdec_query should support duration words, not just codes #48

Closed mkoohafkan closed 5 years ago

mkoohafkan commented 6 years ago

Calling cdec_datasets will return a data frame with a duration column, where duration might be "event", "hourly", etc. However, cdec_query requires a "duration code", which is really just the first letter of the duration label retrieved by cdec_datasets. It would be nice if cdec_query supported either specification, e.g. just do

duration_code = substr(duration_code, 1,1)

inside cdec_query so that passing either the code or the whole word is accepted. This would be helpful in dplyr chains that pipe cdec_stations %>% cdec_datasets %>% cdec_query.