omit {divDyn} | R Documentation |
Omission of taxa that have a poor occurrence record
Description
Function to quickly omit single-collection and single-reference taxa.
Usage
omit(
x,
om = "ref",
tax = "genus",
bin = "bin",
coll = NULL,
ref = NULL,
filterNA = FALSE
)
Arguments
x |
|
om |
|
tax |
|
bin |
|
coll |
|
ref |
|
filterNA |
|
Details
The function returns a logical
vector, with a value for each row. TRUE
values indicate rows to be omitted, FALSE
values indicate rows to be kept. The function is embedded in the divDyn
function, but can be called independently.
Value
A logical vector.
Examples
# omit single-reference taxa
data(corals)
data(stages)
toOmit <- omit(corals, bin="stg", tax="genus", om="ref", ref="reference_no")
x <- corals[!toOmit,]
# within divDyn
# plotting
tsplot(stages, shading="series", boxes="sys", xlim=c(260,0),
ylab="range-through diversity (genera)", ylim=c(0,230))
# multiple ref/slice required
ddNoSing <- divDyn(corals, tax="genus", bin="stg", om="binref", ref="reference_no")
lines(stages$mid, ddNoSing$divRT, lwd=2, col="red")
# with the recent included (NA reference value)
ddNoSingRec <- divDyn(corals, tax="genus", bin="stg",
om="binref", filterNA=TRUE,ref="reference_no")
lines(stages$mid, ddNoSingRec$divRT, lwd=2, col="blue")
# legend
legend("topleft", legend=c("no single-ref. taxa",
"no single-ref. taxa,\n with recent"),
col=c("red", "blue"), lwd=c(2,2))