WaterLevelDataFrame {hyd1d}R Documentation

Initialize a WaterLevelDataFrame

Description

To initialize an object of class WaterLevelDataFrame this function should be used. It checks all the required input data and validates the final object.

Usage

WaterLevelDataFrame(
  river = c("Elbe", "Rhine"),
  time,
  gauging_stations = NULL,
  gauging_stations_missing = NULL,
  comment = NULL,
  id = NULL,
  station = NULL,
  station_int = NULL,
  w = NULL
)

Arguments

river

a required argument to fill the WaterLevelDataFrame-slot river. It has to be type character, has to have a length of one and can be either Elbe or Rhine.

time

a required argument to fill the WaterLevelDataFrame-slot time. It has to be type c("POSIXct", "POSIXt"), has to have a length of one and must be in the temporal range between 1960-01-01 00:00:00 CET and now (Sys.time()) or be NA.

gauging_stations

a slot of class data.frame. gauging_stations has to be a data.frame with the following columns and column types: id (integer), gauging_station (character), uuid (character), km (numeric), km_qps (numeric), river (character), longitude (numeric), latitude (numeric), mw (numeric), pnp (numeric), w (numeric), wl (numeric), n_wls_below_w_do (integer), n_wls_above_w_do (integer), n_wls_below_w_up (integer), n_wls_above_w_up (integer), name_wl_below_w_do (character), name_wl_above_w_do (character), name_wl_below_w_up (character), name_wl_above_w_up (character), w_wl_below_w_do (numeric), w_wl_above_w_do (numeric), w_wl_below_w_up (numeric), w_wl_above_w_up (numeric), weight_up (numeric), weight_do (numeric).

gauging_stations_missing

an optional argument to fill the WaterLevelDataFrame-slot gauging_stations_missing. It has to be type character and usually contains a vector with names of gauging stations for which no water level information was available for the specified time. This argument is used by the functions waterLevel, waterLevelPegelonline, waterLevelFlys3 and waterLevelFlys3Seq.

comment

an optional argument to fill the WaterLevelDataFrame-slot comment. It has to be type character and is used by the functions WaterLevelDataFrame, waterLevel, waterLevelPegelonline, waterLevelFlys3 and waterLevelFlys3Seq.

id

an optional argument to hand over the row.names(wldf). id has to be type integer and has to have the same length as other optional arguments (station, station_int and w) forming the data.frame-component of a WaterLevelDataFrame.

station

an optional argument to hand over the stationing along the specified river. If specified, it has to be type numeric and has to have the same length as other optional arguments (id, station_int and w) forming the data.frame-component of a WaterLevelDataFrame. If both stationing arguments (station and station_int) are specified, all elements of station have to be equal to as.numeric(station_int / 1000). Minimum and maximum allowed values of station are river-specific: Elbe (km 0 - 585.7), Rhine (km 336.2 - 865.7).

station_int

an optional argument to hand over the stationing along the specified river. If specified, it has to be type integer and has to have the same length as other optional arguments (id, station and w) forming the data.frame-component of a WaterLevelDataFrame. If both stationing arguments (station and station_int) are specified, all elements of station_int have to be equal to as.integer(station * 1000). Minimum and maximum allowed values of station_int are river-specific: Elbe (m 0 - 585700), Rhine (m 336200 - 865700).

w

an optional argument to hand over the water level information along the stationing of the specified river for a given time. If specified, it has to be type numeric and has to have the same length as other optional arguments (id, station and station_int) forming the data.frame-component of a WaterLevelDataFrame. If not specified, the respective WaterLevelDataFrame-column w can be computed by the functions waterLevel, waterLevelPegelonline, waterLevelFlys3 and waterLevelFlys3Seq. Minimum and maximum allowed values of w are river-specific: Elbe (m a.s.l. 0 - 130), Rhine (m a.s.l. 5 - 120).

Value

The function produces an object of class WaterLevelDataFrame which might contain 1d water level data and information to recompute it.

Examples

wldf <- WaterLevelDataFrame(river   = "Elbe",
                            time    = as.POSIXct("2016-12-21"),
                            station = seq(257, 262, 0.1))
wldf <- waterLevel(wldf)


[Package hyd1d version 0.5.2 Index]