Skip to contents

Joins species-level plant traits from GIFT, the Global Inventory of Floras and Traits (Weigelt et al. 2020), to a taxify() result by accepted_name. GIFT aggregates published trait records to one value per species (mean for numeric traits, most frequent entry for categorical ones). cols chooses which traits to attach; browse the available columns with enrichment_cols().

Usage

add_gift(x, cols = NULL, verbose = TRUE)

Arguments

x

A data.frame returned by taxify().

cols

Which GIFT trait columns to attach. One of: NULL (the default) for a convenient set of well-populated traits; the string "all" for every bundled trait; or a character vector of gift_ column names (e.g. "plant_height_max", with or without the gift_ prefix). See enrichment_cols(). When left NULL, a one-time message notes the default set and how to request all traits.

verbose

Logical. Default TRUE.

Value

The same data.frame with one added column per requested trait, named gift_<trait>. Numeric traits (heights, masses, areas) are doubles, the rest character. Rows with no value in GIFT get NA. With the default cols, the added columns are gift_woodiness_1, gift_growth_form_1, gift_lifecycle_1, gift_life_form_1, gift_climber_1, gift_epiphyte_1, gift_parasite_1, gift_aquatic_1, gift_plant_height_max, gift_photosynthetic_pathway, gift_seed_mass_mean, gift_dispersal_syndrome_1, gift_flowering_start, gift_flowering_end, gift_deciduousness_1, and gift_sla_mean.

Details

The GIFT trait table is bundled as a pre-built .vtr and joined offline, so no internet access is needed once it is present (the first use downloads it, or builds it from source if taxifydb is installed). GIFT's API exposes only the redistributable subset of its data (CC BY 4.0; references whose underlying source is restricted are excluded), and that subset is what is bundled here. Cite GIFT and, where applicable, the underlying references (GIFT::GIFT_references()) for the values used.

References

Weigelt P, Konig C, Kreft H (2020) GIFT - A Global Inventory of Floras and Traits for macroecology and biogeography. Journal of Biogeography 47:16-43. doi:10.1111/jbi.13623 Denelle P, Weigelt P, Kreft H (2023) GIFT: an R package to access the Global Inventory of Floras and Traits. Methods in Ecology and Evolution 14:2738-2748. doi:10.1111/2041-210X.14213

See also

enrichment_cols() to browse the available columns.

Examples

old <- options(taxify.data_dir = taxify_example_data())

taxify("Abies alba") |>
  add_gift()
#> Matching 1 names against 8 backbones: col -> wcvp -> lcvp -> wfo -> fishbase -> sealifebase -> reptiledb -> gbif
#>   [col] Matching 1 names...
#>   [wcvp] Matching 1 remaining names...
#>   [lcvp] Matching 1 remaining names...
#>   [wfo] Matching 1 remaining names...
#>   [fishbase] Skipped (all names matched)
#>   [sealifebase] Skipped (all names matched)
#>   [reptiledb] Skipped (all names matched)
#>   [gbif] Skipped (all names matched)
#> add_gift(): attaching 16 of 32 columns. Pass cols = "all" for all, or see enrichment_cols("gift").
#>   input_name matched_name accepted_name   taxon_id accepted_id    rank   family
#> 1 Abies alba   Abies alba    Abies alba wfo-ex-005  wfo-ex-005 species Pinaceae
#>   genus epithet authorship accepted_authorship is_synonym taxonomic_status
#> 1 Abies    alba      Mill.               Mill.      FALSE         ACCEPTED
#>   is_hybrid match_type fuzzy_dist backbone         backbone_version
#> 1     FALSE      exact         NA      wfo wfo:example (2026-06-24)
#>   kingdom_group taxon_group  life_form qualifier qualifier_position
#> 1       plantae  gymnosperm gymnosperm      <NA>               <NA>
#>   aggregate_fallback hybrid_type gift_woodiness_1 gift_growth_form_1
#> 1                 NA        <NA>            woody               tree
#>           gift_lifecycle_1         gift_life_form_1         gift_climber_1
#> 1 example_gift_lifecycle_1 example_gift_life_form_1 example_gift_climber_1
#>           gift_epiphyte_1         gift_parasite_1         gift_aquatic_1
#> 1 example_gift_epiphyte_1 example_gift_parasite_1 example_gift_aquatic_1
#>   gift_plant_height_max         gift_photosynthetic_pathway gift_seed_mass_mean
#> 1                    65 example_gift_photosynthetic_pathway           0.0739425
#>           gift_dispersal_syndrome_1         gift_flowering_start
#> 1 example_gift_dispersal_syndrome_1 example_gift_flowering_start
#>           gift_flowering_end         gift_deciduousness_1 gift_sla_mean
#> 1 example_gift_flowering_end example_gift_deciduousness_1          58.7
#> Sources: WFO example, GIFT (Weigelt et al. 2020) example | cite() for full citations

options(old)