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 typecharacter
, 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 typec("POSIXct", "POSIXt")
, has to have a length of one and must be in the temporal range between1960-01-01 00:00:00 CET
and now (Sys.time()
) or beNA
.- gauging_stations
a slot of class
data.frame
.gauging_stations
has to be adata.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 typecharacter
and usually contains a vector with names of gauging stations for which no water level information was available for the specifiedtime
. This argument is used by the functionswaterLevel
,waterLevelPegelonline
,waterLevelFlys3
andwaterLevelFlys3Seq
.- comment
an optional argument to fill the WaterLevelDataFrame-slot
comment
. It has to be typecharacter
and is used by the functionsWaterLevelDataFrame
,waterLevel
,waterLevelPegelonline
,waterLevelFlys3
andwaterLevelFlys3Seq
.- id
an optional argument to hand over the
row.names(wldf)
.id
has to be typeinteger
and has to have the same length as other optional arguments (station
,station_int
andw
) forming thedata.frame
-component of a WaterLevelDataFrame.- station
an optional argument to hand over the stationing along the specified
river
. If specified, it has to be typenumeric
and has to have the same length as other optional arguments (id
,station_int
andw
) forming thedata.frame
-component of a WaterLevelDataFrame. If both stationing arguments (station
andstation_int
) are specified, all elements ofstation
have to be equal toas.numeric(station_int / 1000)
. Minimum and maximum allowed values ofstation
areriver
-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 typeinteger
and has to have the same length as other optional arguments (id
,station
andw
) forming thedata.frame
-component of a WaterLevelDataFrame. If both stationing arguments (station
andstation_int
) are specified, all elements ofstation_int
have to be equal toas.integer(station * 1000)
. Minimum and maximum allowed values ofstation_int
areriver
-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 giventime
. If specified, it has to be typenumeric
and has to have the same length as other optional arguments (id
,station
andstation_int
) forming thedata.frame
-component of a WaterLevelDataFrame. If not specified, the respective WaterLevelDataFrame-columnw
can be computed by the functionswaterLevel
,waterLevelPegelonline
,waterLevelFlys3
andwaterLevelFlys3Seq
. Minimum and maximum allowed values ofw
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)