Extract or replace parts of a WaterLevelDataFrame
Source:R/WaterLevelDataFrame-methods.R
extract.WaterLevelDataFrame.Rd
Extract or replace subsets of the .Data
slot of an object
of class WaterLevelDataFrame.
Usage
# S4 method for class 'WaterLevelDataFrame'
x[i, j]
# S4 method for class 'WaterLevelDataFrame,ANY,ANY,data.frame'
x[i, j] <- value
Arguments
- x
object of class WaterLevelDataFrame.
- i, j
elements to extract or replace. For
[
, these arenumeric
orcharacter
or empty. Numeric values are coerced to integer as if byas.integer
. For replacement by[
, a logical matrix is allowed.- value
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.
Value
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.
Details
For details see [.data.frame
.
Examples
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), ]