rtry_exclude {rtry} | R Documentation |
Exclude (remove) data
Description
This function takes the input data frame or data table and excludes all records (rows)
with the same value in the attribute specified in the argument baseOn
if the criteria
specified in the arguments for excluding (...
) are fulfilled for one of those records.
Usage
rtry_exclude(input, ..., baseOn, showOverview = TRUE)
Arguments
input |
Input data frame or data table. |
... |
Criteria for excluding. |
baseOn |
The attribute on which excluding is based on. If it is set to |
showOverview |
Default |
Value
An object of the same type as the input data after excluding.
References
This function makes use of the subset
function
within the base
package.
Examples
# Example 1: Exclude observations on juvenile plants or unknown state:
# Identify observations where the plant developmental status (DataID 413) is either
# "juvenile" or "unknown", and exclude the whole observation
data_filtered <- rtry_exclude(data_TRY_15160,
(DataID %in% 413) & (OrigValueStr %in% c("juvenile", "unknown")),
baseOn = ObservationID)
# Expected message:
# dim: 1618 28
# Example 2: Exclude outliers:
# Identify the outliers, i.e. trait records where the ErrorRisk is larger than 4
# and exclude these records (not the whole observation)
data_filtered <- rtry_exclude(data_TRY_15160,
ErrorRisk > 4,
baseOn = ObsDataID)
# Expected message:
# dim: 1778 28
# Learn more applications of the excluding function via the vignette (Workflow for
# general data preprocessing using rtry): vignette("rtry-workflow-general").