View source: R/pm_ecoregions.R
| pm_ecoregion_summary | R Documentation |
Computes a summary of species richness and endemism for each ecoregion in the Peruvian mammal backbone.
pm_ecoregion_summary(sort_by = c("code", "species", "endemic", "label"))
sort_by |
Character string indicating how to sort the results. Options are:
|
The summary is based on the long-format table
peru_mammals_ecoregions and joins metadata from
peru_mammals_ecoregions_meta and endemism information
from peru_mammals.
A tibble with one row per ecoregion and the following columns:
ecoregion_code – ecoregion abbreviation.
ecoregion_label – ecoregion description in Spanish.
n_species – total number of species recorded in the ecoregion.
n_endemic – number of endemic species recorded in the ecoregion.
pct_endemic – percentage of endemic species in the ecoregion.
pm_list_ecoregions() for ecoregion metadata,
pm_by_ecoregion() to list species by ecoregion.
# Get summary for all ecoregions (sorted by code)
pm_ecoregion_summary()
# Sort by species richness
pm_ecoregion_summary(sort_by = "species")
# Sort by number of endemic species
pm_ecoregion_summary(sort_by = "endemic")
# Find ecoregion with highest species richness
eco_summary <- pm_ecoregion_summary(sort_by = "species")
eco_summary[1, ]
# Ecoregions with more than 100 species
eco_summary <- pm_ecoregion_summary()
subset(eco_summary, n_species > 100)
# Compare richness between lowland and highland ecoregions
eco_summary <- pm_ecoregion_summary(sort_by = "species")
lowland <- eco_summary[eco_summary$ecoregion_code %in% c("SB", "SP"), ]
highland <- eco_summary[eco_summary$ecoregion_code %in% c("PUN", "PAR"), ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.