wcvp_summary {rWCVP}R Documentation

Generate a summary table from the WCVP

Description

Generate a summary table from the WCVP

Usage

wcvp_summary(
  taxon = NULL,
  taxon_rank = c("species", "genus", "family", "order", "higher"),
  area_codes = NULL,
  grouping_var = c("area_code_l3", "genus", "family", "order", "higher"),
  hybrids = FALSE,
  wcvp_names = NULL,
  wcvp_distributions = NULL
)

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 is NULL.

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 to area_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.

Value

Data.frame with filtered data, or a gt table

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)
}



[Package rWCVP version 1.2.4 Index]