Generate a summary table from the WCVP
Arguments
- taxon
Character. Taxon to be included. Defaults to NULL (no taxonomic filter; all taxa).
- taxon_rank
Character. One of "genus", "family", "order" or "higher", giving the rank of the value/s in
taxon. Must be specified unless taxon isNULL.- area_codes
Character. One or many WGSPRD level 3 region codes. Defaults to
NULL(global).- grouping_var
Character; one of
"area_code_l3", "genus", "family","order"or"higher"specifying how the summary should be arranged. Defaults toarea_code_l3.- hybrids
Logical. Include hybrid species in counts? Defaults to FALSE.
- wcvp_names
A data frame of taxonomic names from WCVP version 7 or later. If
NULL, names will be loaded from rWCVPdata::wcvp_names.- wcvp_distributions
A data frame of distributions from WCVP version 7 or later. If
NULL, distributions will be loaded from rWCVPdata::wcvp_names.
Details
Valid values for rank 'higher' are 'Angiosperms', 'Gymnosperms', 'Ferns' and 'Lycophytes'.
Note that grouping variable (if taxonomic) should be of a lower level than taxon and taxon_rank to produce a meaningful summary (i.e., it does not make sense to group a genus by genus, family or higher classification).
Additionally, if the grouping variable is taxonomic then species occurrences are aggregated across the input area. This means that if a species is native to any of the input area (even if it is introduced or extinct in other parts) it is counted as 'Native'. Similarly, introduced occurrences take precedence over extinct occurrences. Note that in this type of summary table, 'Endemic' means endemic to the input area, not necessarily to a single WGSRPD Level 3 Area within the input area.
Examples
# this example requires 'rWCVPdata'
if(requireNamespace("rWCVPdata")){
ferns <- wcvp_summary("Ferns", "higher", get_wgsrpd3_codes("New Zealand"), grouping_var = "family")
wcvp_summary_gt(ferns)
}
#> ℹ Matches to input geography found at Country (Gallagher) and Region (Level 2)
#> ℹ Aggregating occurrence types across input area ("New Zealand") - see `?wcvp_summary()` for details.
Ferns of New Zealand
Total number of species: 209
Number of regionally endemic species: 78
Family
Native
Endemic
Introduced
Extinct
Total
