Skip to contents

This function calculates the taxonomic distinctness index (TDI) over a gridded map or as a time series (see 'Details' for more information).

Usage

tax_distinct_map(data, rows = 1, ...)

tax_distinct_ts(data, rows = 1, ...)

Arguments

data

A data cube object (class 'processed_cube').

rows

Choose which row to select if there are multiple matches when retrieving taxonomic information from GBIF. (Default is 1. Use NA for interactive mode.)

...

Arguments passed on to compute_indicator_workflow

ci_type

Type of bootstrap confidence intervals to calculate. (Default: "norm". Select "none" to avoid calculating bootstrap CIs.)

cell_size

Length of grid cell sides, in km. (Default: 10 for country, 100 for continent or world)

level

Spatial level: 'cube', 'continent', 'country', 'world', 'sovereignty', or 'geounit'. (Default: 'cube')

region

The region of interest (e.g., "Europe"). (Default: "Europe")

ne_type

The type of Natural Earth data to download: 'countries', 'map_units', 'sovereignty', or 'tiny_countries'. (Default: "countries")

ne_scale

The scale of Natural Earth data to download: 'small' - 110m, 'medium' - 50m, or 'large' - 10m. (Default: "medium")

output_crs

The CRS you want for your calculated indicator. (Leave blank to let the function choose a default based on grid reference system)

first_year

Exclude data before this year. (Uses all data in the cube by default.)

last_year

Exclude data after this year. (Uses all data in the cube by default.)

spherical_geometry

If set to FALSE, will temporarily disable spherical geometry while the function runs. Should only be used to solve specific issues. (Default is TRUE)

make_valid

Calls st_make_valid() from the sf package. Increases processing time but may help if you are getting polygon errors. (Default is FALSE).

num_bootstrap

Set the number of bootstraps to calculate for generating confidence intervals. (Default: 1000)

shapefile_path

Path of an external shapefile to merge into the workflow. For example, if you want to calculate your indicator particular features such as protected areas or wetlands.

shapefile_crs

CRS of a .wkt shapefile. If your shapefile is .wkt and you do NOT use this parameter, the CRS will be assumed to be EPSG:4326 and the coordinates will be read in as lat/long. If your shape is NOT a .wkt the CRS will be determined automatically.

invert

Calculate an indicator over the inverse of the shapefile (e.g. if you have a protected areas shapefile this would calculate an indicator over all non protected areas)

include_ocean

Include occurrences which fall outside the land area. Default is TRUE. Set as "buffered_coast" to include a set buffer size around the land area rather than the entire ocean area.

buffer_dist_km

The distance to buffer around the land if include_ocean is set to "buffered_coast".

force_grid

Forces the calculation of a grid even if this would not normally be part of the pipeline, e.g. for time series. This setting is required for the calculation of rarity, and is turned on by the ab_rarity_ts and area_rarity_ts wrappers. (Default: FALSE)

Value

An S3 object with the classes 'indicator_map' or 'indicator_ts' and 'tax_distinct' containing the calculated indicator values and metadata.

Details

Taxonomic distinctness is an essential biodiversity variable (EBV) that measures the taxonomic relatedness between species, providing a measure of biodiversity that accounts for evolutionary relationships. A distance matrix based on pairwise taxonomic relationships is calculated for each cell using the taxize package (Chamberlain & Szöcs, 2013; Chamberlain et al., 2020), then taxonomic distinctness is calculated as the Taxonomic Distinctness Index (TDI; Clarke & Warwick, 1999): $$ \frac{\sum\sum_{i<j} \frac{|R_i - R_j|}{L}}{\frac{S(S-1)}{2}} $$ where S is the number of species, Ri and Rj are the taxonomic ranks of species i and j (from the GBIF Taxonomic Backbone), and L is the maximum number of taxonomic ranks. The TDI ranges from 0 to 1, with higher values indicating greater taxonomic distinctness.

Functions

  • tax_distinct_map():

  • tax_distinct_ts():

References

Chamberlain, S. A., & Szöcs, E. (2013). taxize: taxonomic search and retrieval in R. F1000Research, 2.

Chamberlain, S., Szoecs, E., Foster, Z., Boettiger, C., Ram, K., Bartomeus, I., Baumgartner, J., O'Donnell, J., Oksanen, J., Tzovaras, B. G., Marchand, P., Tran, V., Salmon, M., Li, G., & Grenié, M. (2020). taxize: Taxonomic Information from Around the Web. R package version 0.9.98. https://github.com/ropensci/taxize.

Clarke, K. R., & Warwick, R. M. (1999). The taxonomic distinctness measure of biodiversity: weighting of step lengths between hierarchical levels. Marine Ecology Progress Series, 184, 21-29.

See also

compute_indicator_workflow

Examples

if (FALSE) { # \dontrun{
td_map <- tax_distinct_map(example_cube_1, level = "country", region = "Denmark")
plot(td_map)
} # }

if (FALSE) { # \dontrun{
td_ts <- tax_distinct_ts(example_cube_1, level = "country", region = "Denmark")
plot(td_ts)
} # }