pm_ecoregion_summary: Summary of species richness by ecoregion

View source: R/pm_ecoregions.R

pm_ecoregion_summaryR Documentation

Summary of species richness by ecoregion

Description

Computes a summary of species richness and endemism for each ecoregion in the Peruvian mammal backbone.

Usage

pm_ecoregion_summary(sort_by = c("code", "species", "endemic", "label"))

Arguments

sort_by

Character string indicating how to sort the results. Options are:

  • "code" (default) – sort alphabetically by ecoregion code.

  • "species" – sort by number of species (descending).

  • "endemic" – sort by number of endemic species (descending).

  • "label" – sort alphabetically by ecoregion label.

Details

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.

Value

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.

See Also

pm_list_ecoregions() for ecoregion metadata, pm_by_ecoregion() to list species by ecoregion.

Examples

# 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"), ]


perumammals documentation built on Jan. 6, 2026, 5:06 p.m.