Skip to contents

For each species computes the percentage of sites where the species is present (distribution value higher than 0 and non-NA).

Usage

fb_count_sites_by_species(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:

  • species: the name of the species;

  • n_sites: the number of sites where the species is present;

  • coverage: the percentage of sites where the species is present.

Examples

library("funbiogeo")

data("site_species")

site_coverage_by_species <- fb_count_sites_by_species(site_species)
head(site_coverage_by_species)
#>   species n_sites  coverage
#> 1  sp_078    1499 0.9960133
#> 2  sp_006    1482 0.9847176
#> 3  sp_119    1476 0.9807309
#> 4  sp_149    1475 0.9800664
#> 5  sp_057    1449 0.9627907
#> 6  sp_084    1426 0.9475083