Skip to contents

Compatibility alias matching the RCamelsPE::read_timeseries() interface, powered by the high-performance 'arrow' dataset and 'collapse' query engine.

Usage

read_timeseries(
  gauge_id = NULL,
  global = FALSE,
  vars = NULL,
  start_date = NULL,
  end_date = NULL,
  path = get_camels_pe_path()
)

Arguments

gauge_id

Character vector or NULL. Gauge identifiers to read.

global

Logical value. If TRUE, forces reading from the global file. If FALSE, reads individual catchment files when available.

vars

Character vector or NULL. Optional variable names to retain.

start_date

Optional character string or Date ("YYYY-MM-DD").

end_date

Optional character string or Date ("YYYY-MM-DD").

path

Character string. Optional path to the CAMELS-PE root directory.

Value

A data.frame containing CAMELS-PE time series data.

Examples

# Read timeseries using RCamelsPE compatible syntax
ts <- read_timeseries(gauge_id = "PE_110139", vars = c("date", "prec", "flow_obs"))
head(ts)
#>         date  gauge_id  prec flow_obs
#> 1 1981-01-01 PE_110139 0.265       NA
#> 2 1981-01-02 PE_110139 1.278       NA
#> 3 1981-01-03 PE_110139 3.587       NA
#> 4 1981-01-04 PE_110139 9.783       NA
#> 5 1981-01-05 PE_110139 2.322       NA
#> 6 1981-01-06 PE_110139 0.989       NA