pm_by_ecoregion: List species by ecoregion

View source: R/pm_ecoregions.R

pm_by_ecoregionR Documentation

List species by ecoregion

Description

Convenience wrapper to list species occurring in one or more Peruvian ecoregions. This function uses pm_species() internally and therefore supports the same taxonomic and endemism filters.

Usage

pm_by_ecoregion(
  ecoregion,
  order = NULL,
  family = NULL,
  genus = NULL,
  endemic = NULL
)

Arguments

ecoregion

Character vector with one or more ecoregion codes (e.g. "YUN", "SB", "COS"). At least one code must be provided. Invalid codes will generate a warning.

order

Optional character vector with one or more taxonomic orders to keep. If NULL (default), no filter is applied by order.

family

Optional character vector with one or more families to keep. If NULL (default), no filter is applied by family.

genus

Optional character vector with one or more genera to keep. If NULL (default), no filter is applied by genus.

endemic

Optional logical. If TRUE, only endemic species are returned; if FALSE, only non-endemic species are returned; if NULL (default), no filter is applied by endemism.

Value

A tibble with a subset of rows from peru_mammals corresponding to species present in at least one of the requested ecoregions. Returns an empty tibble if no species match the criteria.

See Also

pm_list_ecoregions() to see available ecoregion codes, pm_species() for the underlying function.

Examples

# All species in Yungas
pm_by_ecoregion("YUN")

# Endemic species in Selva Baja (SB)
pm_by_ecoregion("SB", endemic = TRUE)

# Rodents in Costa and Vertiente Occidental
pm_by_ecoregion(c("COS", "VOC"), order = "Rodentia")

# Bats in multiple ecoregions
pm_by_ecoregion(c("YUN", "SB"), order = "Chiroptera")
pm_by_ecoregion(c("YUN", "SB"), order = "Chiroptera",
endemic =  TRUE)


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