Skip to contents

For each site computes the proportion of species present (distribution value higher than 0 and non-NA) compared to all species provided. For example, a site could contain only 20% of all species provided.

Usage

fb_count_species_by_site(site_species)

Arguments

site_species

a data.frame with sites in rows and species in columns. NOTE: the first column should be named "site" and indicate site names. The other columns should be named according to species names.

Value

A three-column data.frame with:

  • site: the name of the site;

  • n_species: the number of present species;

  • coverage: the percentage of present species.

Examples

library("funbiogeo")

data("site_species")

species_coverage_by_site <- fb_count_species_by_site(site_species)
head(species_coverage_by_site)
#>   site n_species  coverage
#> 1  980        68 0.4563758
#> 2 1022        68 0.4563758
#> 3  931        67 0.4496644
#> 4  975        67 0.4496644
#> 5  933        66 0.4429530
#> 6  966        66 0.4429530