Generate occurrence matrix for taxa and areas
Usage
wcvp_occ_mat(
taxon = NULL,
taxon_rank = c("species", "genus", "family", "order", "higher"),
area_codes = NULL,
native = TRUE,
introduced = TRUE,
extinct = TRUE,
location_doubtful = TRUE,
wcvp_names = NULL,
wcvp_distributions = NULL
)
Arguments
- taxon
Character. One or many taxa to be included. Defaults to NULL (all species)
- taxon_rank
Character. One of "species", "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).- native
Logical. Include species occurrences not flagged as introduced, extinct or doubtful? Defaults to TRUE.
- introduced
Logical. Include species occurrences flagged as introduced? Defaults to TRUE.
- extinct
Logical. Include species occurrences flagged as extinct? Defaults to TRUE.
- location_doubtful
Logical. Include species occurrences flagged as location doubtful? Defaults to TRUE.
- 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.
Value
A data.frame containing the taxon_name
and plant_name_id
of all species that are present in the area
, plus one variable for each WGSPRD level 3 region in area
, with species presences marked as 1 and absences marked as 0.
Details
See here for an example of how this output can be formatted for publication.
Examples
# this example requires 'rWCVPdata'
if(requireNamespace("rWCVPdata")){
wcvp_occ_mat(
taxon = "Poa", taxon_rank = "genus",
area = c("TAS", "VIC", "NSW"), introduced = FALSE
)
}
#> # A tibble: 37 × 5
#> plant_name_id taxon_name NSW TAS VIC
#> <dbl> <chr> <dbl> <dbl> <dbl>
#> 1 435044 Poa affinis 1 0 1
#> 2 469193 Poa amplexicaulis 0 0 1
#> 3 435565 Poa cheelii 1 0 0
#> 4 435598 Poa clelandii 0 1 1
#> 5 435599 Poa clivicola 1 1 1
#> 6 435658 Poa costiniana 1 1 1
#> 7 435661 Poa crassicaudex 0 0 1
#> 8 435797 Poa drummondiana 0 0 1
#> 9 435841 Poa ensiformis 1 0 1
#> 10 435878 Poa fawcettiae 1 1 1
#> # ℹ 27 more rows