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"
)

Arguments

data

ws_monitor object data dataframe

tlim

optional vector with start and end times (integer or character representing YYYYMMDD[HH] or POSIXct)

vlim

optional vector with low and high data value limits

monitorIDs

optional vector of monitorIDs

dropMonitors

flag specifying whether to remove columns -- defaults to FALSE

timezone

Olson timezone passed to parseDatetime when parsing numeric tlim

Value

A ws_monitor object data dataframe, or NULL if filtering removes all monitors.

Details

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]