Skip to contents

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

Usage

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

  • species: the name of the species;

  • n_traits: the number of traits with non-missing value for the species;

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

Examples

library("funbiogeo")

data("species_traits")

trait_coverage_by_species <- fb_count_traits_by_species(species_traits)
head(trait_coverage_by_species)
#>   species n_traits coverage
#> 1  sp_001        6        1
#> 2  sp_006        6        1
#> 3  sp_011        6        1
#> 4  sp_012        6        1
#> 5  sp_013        6        1
#> 6  sp_014        6        1