Skip to contents

For each trait computes the percentage of species without NA (missing trait values).

Usage

fb_count_species_by_trait(species_traits)

Arguments

species_traits

a data.frame with species in rows and traits as columns. NOTE: The first column should be named "species" and contain species names. The other columns should be named according to trait names.

Value

A three-column data.frame with:

  • trait: the name of the trait;

  • n_species: the number of species with non-missing value for the trait;

  • coverage: the percentage of species with non-missing value for the trait.

Examples

library("funbiogeo")

data("species_traits")

species_coverage_by_trait <- fb_count_species_by_trait(species_traits)
head(species_coverage_by_trait)
#>                 trait n_species  coverage
#> 1     adult_body_mass       123 0.8255034
#> 2         litter_size       114 0.7651007
#> 3    gestation_length        88 0.5906040
#> 4 sexual_maturity_age        84 0.5637584
#> 5        diet_breadth        83 0.5570470
#> 6       max_longevity        81 0.5436242