DropPatterns {lifeR} | R Documentation |
Drop species with given patterns in name
DropPatterns(
data,
patterns = c("sp.", "/", "Domestic type", "hybrid"),
colname = "comName"
)
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
|
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.
Copy of data
with any rows that has values in colname
that match values in patterns
.
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)