Creates a subset ws_monitor based on one or more optional input parameters.
If any input parameter is not specified, that parameter will not be used to subset ws_monitor
.
monitor_subset(
ws_monitor,
xlim = NULL,
ylim = NULL,
tlim = NULL,
vlim = NULL,
monitorIDs = NULL,
stateCodes = NULL,
countryCodes = NULL,
dropMonitors = TRUE,
timezone = "UTC"
)
ws_monitor object
optional vector with low and high longitude limits
optional vector with low and high latitude limits
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 monitor IDs used to filter the data
optional vector of state codes used to filter the data
optional vector of country codes used to filter the data
flag specifying whether to remove monitors with no data
Olson timezone passed to parseDatetime
when parsing numeric tlim
A ws_monitor object with a subset of ws_monitor
.
By default, this function will return a ws_monitor object whose data
dataframe has the
same number of columns as the incoming dataframe, unless any of the columns consist of all NA
s,
in which case such columns will be removed (e.g. if there are no valid data for a specific monitor
after subsetting by tlim
or vlim
).
If dropMonitors=FALSE
, columns that consist of all NA
s will be retained.
# NOT RUN {
library(PWFSLSmoke)
N_M <- monitor_subset(Northwest_Megafires, tlim=c(20150701,20150731))
xlim <- c(-124.73, -122.80)
ylim <- c(47.20, 48.40)
Olympic_Peninsula <- monitor_subset(N_M, xlim, ylim)
monitor_map(Olympic_Peninsula, cex=2)
rect(xlim[1], ylim[1], xlim[2], ylim[2], col=adjustcolor('black',0.1))
# }
Run the code above in your browser using DataLab