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.
Calling
cdec_datasets
will return a data frame with aduration
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 bycdec_datasets
. It would be nice ifcdec_query
supported either specification, e.g. just doinside
cdec_query
so that passing either the code or the whole word is accepted. This would be helpful indplyr
chains that pipecdec_stations %>% cdec_datasets %>% cdec_query
.