Skip to contents

Extract or replace subsets of the .Data slot of an object of class WaterLevelDataFrame.


# S4 method for WaterLevelDataFrame
[(x, i, j)

# S4 method for WaterLevelDataFrame,ANY,ANY,data.frame
[(x, i, j) <- value



object of class WaterLevelDataFrame.

i, j

elements to extract or replace. For [, these are numeric or character or empty. Numeric values are coerced to integer as if by as.integer. For replacement by [, a logical matrix is allowed.


A suitable replacement value: it will be repeated a whole number of times if necessary and it may be coerced: see the Coercion section. If NULL, deletes the column if a single column is selected.


A new object of class WaterLevelDataFrame is returned. Since the extraction or replacement acts only on the .Data-slot of the object, all other slots remain unchanged.


For details see [.data.frame.

See also


wldf <- WaterLevelDataFrame(river   = "Elbe",
                            time    = as.POSIXct("2016-12-21"),
                            station = seq(257, 262, 0.1))
wldf <- wldf[which(wldf$station >= 259 & wldf$station <= 261), ]