mc_filter | R Documentation |
This function filter data by localities, logger types and sensors.
mc_filter(
data,
localities = NULL,
sensors = NULL,
reverse = FALSE,
stop_if_empty = TRUE,
logger_types = NULL
)
data |
myClim object see myClim-package |
localities |
locality_ids for filtering data; if NULL then do nothing (default NULL) |
sensors |
sensor_names for filtering data; if NULL then do nothing see |
reverse |
if TRUE then input localities and/or sensors are excluded (default FALSE) |
stop_if_empty |
if TRUE then error for empty output (default TRUE) |
logger_types |
types of logger for filtering data; if NULL then do nothing (default NULL). The logger_types parameter can by used only for raw data format see myClim-package. |
In default settings it returns the object containing input localities / logger types / sensors.
When you provide vector of localities e.g. localities=c("A6W79", "A2E32")
selected localities are filtered with all loggers / sensors on those localities.
The same as When you provide vector of logger_types logger_types=c("TMS", "TMS_L45")
selected loggers by type are filtered through all localities
(logger_types criterion is applicable only for raw data format see myClim-package) and
the sensors parameter sensors=c("TMS_T1", "TMS_T2")
,
selected sensors are filtered through all localities.
When you combine localities, logger_types and sensors, then filtering return
selected sensors in selected loggers on selected localities.
Parameter reverse = TRUE
returns myClim object without listed localities, or logger types or sensors.
Using reverse = TRUE
is not allowed for combination of localities and logger types and sensors.
It is allowed to use reverse
only with single filter criterion either locality, logger type or sensor.
reverse = TRUE
and logger_types
are selected then the listed logger types are removed from all localities.
reverse = TRUE
and localities
are selected then the listed localities are removed from myClim object.
reverse = TRUE
and sensors
are selected then listed sensors are removed from all loggers / localities.
filtered myClim object
## keep only "A6W79", "A2E32" localities with all their sensors
filtered_data <- mc_filter(mc_data_example_raw, localities=c("A6W79", "A2E32"))
## remove "A6W79", "A2E32" localities and keep all others
filtered_data <- mc_filter(mc_data_example_raw, localities=c("A6W79", "A2E32"), reverse=TRUE)
## keep only "TMS_T1", and "TMS_T2" sensors on all localities
filtered_data <- mc_filter(mc_data_example_raw, sensors=c("TMS_T1", "TMS_T2"))
## remove "TMS_T1", and "TMS_T2" sensors from all localities
filtered_data <- mc_filter(mc_data_example_raw, sensors=c("TMS_T1", "TMS_T2"),reverse=TRUE)
## keep only "TMS_T1", and "TMS_T2" sensors on "A6W79", "A2E32" localities
filtered_data <- mc_filter(mc_data_example_raw, localities=c("A6W79", "A2E32"),
sensors=c("TMS_T1", "TMS_T2"))
## Remove "Dendro" loggers on all localities
filtered_data <- mc_filter(mc_data_example_raw, logger_types="Dendro", reverse=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.