Subsets a ws_monitor object's data
dataframe by removing any monitors that
lie outisde the specified ranges of time and values and that are not mentioned in the
list of monitorIDs.
If tlim
or vlim
is not specified, it will not be used in the subsetting.
Intended for use by the monitor_subset function.
monitor_subsetData(data, tlim = NULL, vlim = NULL, monitorIDs = NULL,
dropMonitors = FALSE, timezone = "UTC")
ws_monitor object data
dataframe
optional vector with start and end times (integer or character representing YYYYMMDD[HH] or POSIXct
)
optional vector with low and high data value limits
optional vector of monitorIDs
flag specifying whether to remove columns -- defaults to FALSE
Olson timezone passed to link{parseDatetime}
when parsing numeric tlim
A ws_monitor object data
dataframe, or NULL
if filtering removes all monitors.
By default, filtering by tlim or vlim will always return a dataframe with the
same number of columns as the incoming dataframe. If dropMonitors=TRUE
, columns
will be removed if there are not valid data for a specific monitor after subsetting.
Filtering by vlim is open on the left and closed on the right, i.e.
x > vlim[1] & x <= vlim[2]