knitr::opts_chunk$set( collapse = TRUE, comment = "#>", out.width = "100%" ) # Load package functions devtools::load_all()
Bring near real-time hydrometric data from the Government of Canada's DataMart service into R.
Note that much of this funcionality is built into tidyhydat
. Use that if you can.
if(!requireNamespace("remotes")) install.packages("remotes") remotes::install_github('rywhale/rtdd')
By default, dd_hydro_meta
will return metadata for all avaiable stations, across Canada
stn_meta <- dd_hydro_meta() str(stn_meta)
You can also filter by a province or territory short code. See ?dd_hydro_meta
for valid options
ont_stn_meta <- dd_hydro_meta(prov_terr = "ON")
You can retrieve either an individual station's data or all the data available for given a province or territory. There are also multiple update intervals available:
stn_data <- dd_hydro_data(station_id = "05QB002", prov_terr = "ON") str(stn_data)
You can grab all the data for a given province/territory by setting all_stns=TRUE
.
all_stn_data <- dd_hydro_data(prov_terr = "YT", all_stns = TRUE) str(all_stn_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.