Turns the cleaned detections into species richness and diversity: for every
site and time bin, for every site over the whole survey, and across sites
(species accumulation and an estimate of how many species were missed). The
site table can be joined to habitat covariates by site_id to study how
richness varies with the environment.
Arguments
- cfg
A
pam_configobject.- run_id
Detection run (sub-folder of paths$detections).
- bin_days
Length of a time bin in days.
NULLusesoccupancy$occasion_length_days(1 if not set).- min_events
A species counts as present in a site and bin only when it has at least this many events there (a whole number, default 1). A higher number removes species known only from a lone, possibly false, detection, at the cost of missing rare species.
- abundance
How species are weighted in the Hill numbers:
"counts"(the default; the number of events, an activity-based measure) or"presence"(every present species weighs the same, so only occurrence matters).- q
Orders of the Hill numbers to compute besides richness (default 1 and 2). Richness is the Hill number of order 0 and is always returned.
- thresholds
Optional per-species thresholds (a data frame, or the path of a CSV file, with
scientific_nameandthreshold), for example frompam_species_thresholds().- species
Optional species to keep (scientific names, common names or species labels).
NULLkeeps all.- min_effort_hours
Minimum recorded hours for a bin to count as surveyed.
NULLusesoccupancy$min_effort_hours(2 if not set).- write
If
TRUE, also save the four tables to<outputs>/<run_id>/asrichness_occasions.csv,richness_sites.csv,species_accumulation.csvandrichness_estimates.csv.
Value
A list of class pam_richness:
occasions: one row per site and bin:richness,hill_q<q>columns,n_events(events of the species counted as present),effort_hours,n_days,sufficient. Bins below the minimum effort are kept and flagged.sites: one row per site, using only surveyed bins:richness,hill_q<q>,n_events,n_occasions_surveyed,effort_hours.accumulation: the expected number of species (richness) forn_sites= 1 to the number of surveyed sites.estimates: one row with the observed richness, the Chao2 estimate of the total andcompleteness(observed divided by estimated).settings: the choices that were used.
Details
Hill numbers
Hill numbers describe diversity as an effective number of species. Order 1
is the number of equally common species that gives the same Shannon
diversity, and order 2 the same for the Simpson index; larger orders give
more weight to the dominant species. With abundance = "counts" a loud, vocal
species weighs more than a quiet one, so the numbers describe the acoustic
community; use "presence" when only occurrence matters. A bin with no
species has richness 0 and NA for the other orders.
Accumulation and the estimate
Sites are the sampling units. accumulation is the exact expected number of
species found in n randomly chosen surveyed sites (sample-based
rarefaction), so curves from different projects can be compared at the same
number of sites. The Chao2 estimate uses how many species were found in only
one or two sites to estimate how many remain undetected; treat it as a lower
bound. A species with a false-positive detection counts as present, so
validated thresholds and min_events matter for all of these numbers.
Examples
ex <- pam_example_project()
# the later stages read the master table that the scan builds
res <- suppressMessages(pam_scan_audio(ex$cfg))
proc <- suppressMessages(pam_process_detections(ex$cfg))
rich <- suppressMessages(pam_richness(ex$cfg))
as.data.frame(rich$sites)[, c("site_id", "richness", "hill_q1", "hill_q2")]
#> site_id richness hill_q1 hill_q2
#> 1 G0059 2 1.960132 1.923077
#> 2 G0110 3 2.871746 2.777778
rich$estimates
#> n_sites observed singletons doubletons chao2 completeness
#> <int> <int> <int> <int> <num> <num>
#> 1: 2 3 1 2 3.125 0.96
# count a species only when it has at least two events in a bin
strict <- suppressMessages(pam_richness(ex$cfg, min_events = 2))
strict$sites$richness
#> [1] 2 2
