# hyd1d The R package **hyd1d** is designed to compute 1-dimensional water level information along the German Federal Waterways Elbe and Rhine. ## Installation **hyd1d** is available from CRAN. To install it run: ``` r install.packages("hyd1d") ``` To install the latest development version from opencode.de run: ``` r install.packages("pak") library(pak) pak::pak("git::https://gitlab.opencode.de/bafg-bund/hyd1d.git") ``` ## Usage The package **hyd1d** is build around the S4-class `WaterLevelDataFrame`. To compute and visualize 1-dimensional water level information an object of class `WaterLevelDataFrame` has to be initialized. Various functions included in **hyd1d** use these objects and compute water levels stored in the column `w`. ``` r # load the package library(hyd1d) # initialize a WaterLevelDataFrame wldf <- WaterLevelDataFrame(river = "Elbe", time = as.POSIXct("2016-12-21"), station = seq(257, 262, 0.1)) # compute a water level wldf <- waterLevel(wldf, TRUE) # and plot it plotShiny(wldf, TRUE, TRUE, TRUE, xlim = c(256.8, 262.2)) ``` ![example output of hyd1d::plotShiny()](reference/figures/README-usage-1.png) # Package index ## S4 class WaterLevelDataFrame and methods Class definition and functions to initialize or modify a WaterLevelDataFrame - [`WaterLevelDataFrame-class`](https://hyd1d.bafg.de/reference/WaterLevelDataFrame-class.md) : S4 class for 1d water level data - [`WaterLevelDataFrame()`](https://hyd1d.bafg.de/reference/WaterLevelDataFrame.md) : Initialize a WaterLevelDataFrame - [`getGaugingStations()`](https://hyd1d.bafg.de/reference/getGaugingStations.md) : Extract a WaterLevelDataFrame's slot gauging_stations - [`getGaugingStationsMissing()`](https://hyd1d.bafg.de/reference/getGaugingStationsMissing.md) : Extract a WaterLevelDataFrame's slot gauging_stations_missing - [`getRiver()`](https://hyd1d.bafg.de/reference/getRiver.md) : Extract a WaterLevelDataFrame's slot river - [`getTime()`](https://hyd1d.bafg.de/reference/getTime.md) : Extract a WaterLevelDataFrame's slot time - [`` `setGaugingStations<-`() ``](https://hyd1d.bafg.de/reference/setGaugingStations.md) : Set a WaterLevelDataFrame's slot gauging_stations - [`` `setGaugingStationsMissing<-`() ``](https://hyd1d.bafg.de/reference/setGaugingStationsMissing.md) : Set a WaterLevelDataFrame's slot gauging_stations_missing - [`` `setRiver<-`() ``](https://hyd1d.bafg.de/reference/setRiver.md) : Set a WaterLevelDataFrame's slot river - [`` `setTime<-`() ``](https://hyd1d.bafg.de/reference/setTime.md) : Set a WaterLevelDataFrame's slot time ## Utility functions Functions to handle, modify, im- and export WaterLevelDataFrame’s - [`as.data.frame(`*``*`)`](https://hyd1d.bafg.de/reference/as.data.frame.WaterLevelDataFrame.md) : Coerce a WaterLevelDataFrame to a data.frame - [`` `names<-`( ``*``*`,`*``*`)`](https://hyd1d.bafg.de/reference/names.md) : Set names of a WaterLevelDataFrame - [`plotShiny()`](https://hyd1d.bafg.de/reference/plotShiny.md) : Plot a WaterLevelDataFrame in Shiny - [`rbind(`*``*`)`](https://hyd1d.bafg.de/reference/rbind.WaterLevelDataFrame.md) : Combine WaterLevelDataFrames by Rows - [`subset(`*``*`)`](https://hyd1d.bafg.de/reference/subset.WaterLevelDataFrame.md) : Subsetting WaterLevelDataFrames - [`summary(`*``*`)`](https://hyd1d.bafg.de/reference/summary.WaterLevelDataFrame.md) : WaterLevelDataFrame summary - [`` `[`( ``*``*`)`](https://hyd1d.bafg.de/reference/extract.WaterLevelDataFrame.md) [`` `[<-`( ``*``*`,`*``*`,`*``*`,`*``*`)`](https://hyd1d.bafg.de/reference/extract.WaterLevelDataFrame.md) : Extract or replace parts of a WaterLevelDataFrame ## Datasets Datasets included in hyd1d and a function to update df.gauging_data - [`df.flys`](https://hyd1d.bafg.de/reference/df.flys.md) : Stationary water levels from the FLYS 3-database - [`df.flys_sections`](https://hyd1d.bafg.de/reference/df.flys_sections.md) : Reference gauging stations according to FLYS3 - [`df.gauging_data`](https://hyd1d.bafg.de/reference/df.gauging_data.md) : Gauging data for all WSV-run gauging stations along Elbe and Rhine - [`df.gauging_station_data`](https://hyd1d.bafg.de/reference/df.gauging_station_data.md) : Gauging station data for all WSV-run gauging stations along Elbe and Rhine - [`updateGaugingData()`](https://hyd1d.bafg.de/reference/updateGaugingData.md) : Update local copy of `df.gauging data` ## W functions Functions to obtain gauging data - [`getGaugingDataW()`](https://hyd1d.bafg.de/reference/getGaugingDataW.md) : Get W from internal dataset df.gauging_data for the specified gauging station and time - [`getPegelonlineW()`](https://hyd1d.bafg.de/reference/getPegelonlineW.md) : Get W from pegelonline.wsv.de for the specified gauging station and time ## waterLevel functions Functions to compute 1-dimensional water levels - [`waterLevel()`](https://hyd1d.bafg.de/reference/waterLevel.md) [`waterLevelPegelonline()`](https://hyd1d.bafg.de/reference/waterLevel.md) : Compute a 1d water level dataset - [`waterLevelFlood1()`](https://hyd1d.bafg.de/reference/waterLevelFlood1.md) : Compute 1d water level data from the FLYS3 water level MQ and a gauging station according to the INFORM 3-method Flood1 (Flut1) - [`waterLevelFlood2()`](https://hyd1d.bafg.de/reference/waterLevelFlood2.md) : Compute 1d water level data through linear interpolation with neighboring gauging stations according to the INFORM 3-method Flood2 (Flut2) - [`waterLevelFlys3()`](https://hyd1d.bafg.de/reference/waterLevelFlys3.md) [`waterLevelFlys3Seq()`](https://hyd1d.bafg.de/reference/waterLevelFlys3.md) : Obtain 1d water level data from the FLYS3 database - [`waterLevelFlys3InterpolateX()`](https://hyd1d.bafg.de/reference/waterLevelFlys3InterpolateX.md) : Interpolate FLYS3 water levels for given stations - [`waterLevelFlys3InterpolateY()`](https://hyd1d.bafg.de/reference/waterLevelFlys3InterpolateY.md) : Compute a 1d water level dataset based on the FLYS3 algorythms # Articles ### All vignettes - [hyd1d - Vignette](https://hyd1d.bafg.de/articles/hyd1d.md): - [hyd1d - Vignette (DE)](https://hyd1d.bafg.de/articles/vignette_DE.md):