Last chance! 50% off unlimited learning
Sale ends in
Function to quickly omit single-collection and single-reference taxa.
omit(dat, tax = "genus", bin = "bin", coll = "collection_no",
ref = "reference_no", om = "ref", filterNA = FALSE)
(data.frame)
Occurrence dataset, with bin
, tax
and coll
as column names.
(character)
The name of the taxon variable.
(character)
The name of the bin variable (has to be numeric
for the function to run). For time series, this is the time slice variable.
(character)
The variable name of the collection identifiers.
(character)
The variable name of the reference identifiers (optional).
(character)
The type of omission. "coll"
omits occurrences of taxa that occurr only in one collection. "ref"
omits occurrences of taxa that were described only in one reference. "binref"
will omit the set of single reference taxa that were described by more than one references, but appear in only one reference in a time bin.
(logical)
Additional entries can be added to influence the dataset that might not have reference or collection information (NA
entries). These occurrences are treated as single-collection or single-reference taxa if the na.rm
argument is set to FALSE
(default). Setting this argument to TRUE
will keep these entries. (see example)
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.
# NOT RUN {
# omit single-reference taxa
data(corals)
data(stages)
toOmit <- omit(corals, bin="stg", tax="genus", om="ref")
dat <- 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")
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)
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))
# }
Run the code above in your browser using DataLab