DropPatterns {lifeR} | R Documentation |
Drop species with given patterns in name
Description
Drop species with given patterns in name
Usage
DropPatterns(
data,
patterns = c("sp\\.", "\\/", "Domestic type", "hybrid"),
colname = "comName"
)
Arguments
data |
A data.frame with observations, likely the object from a call to
|
patterns |
Character vector of patterns in |
colname |
Character vector indicating column with names to search for
|
Details
This utility function provides a means of omitting observations of
"other taxa" such as domestics, hybrids, and "sp." observations. If
patterns = NULL
, no rows will be dropped.
Value
Copy of data
with any rows that has values in colname
that match values in patterns
.
Examples
df <- data.frame(comName = c("Mallard", "Mallard x Mexican Duck hybrid", "Verdin"),
date = c("2021-01-09", "2021-01-09", "2021-01-09"))
df <- DropPatterns(data = df)
[Package lifeR version 1.0.3 Index]