Skip to contents

The function maps user provided names to accepted species names.

Usage

get_gbif_taxonomy(
  x,
  subspecies = TRUE,
  higherrank = FALSE,
  verbose = FALSE,
  fuzzy = TRUE,
  conf_threshold = 90,
  resolve_synonyms = TRUE
)

Arguments

x

a character string or vector of species names.

subspecies

logical. If TRUE (default), the given name is resolved to subspecies epithet, otherwise it will be mapped to species level.

higherrank

logical. If FALSE (default), it will not allow remapping of unknown species names to higher taxon ranks (e.g. genus).

verbose

logical. If FALSE (default), warnings and messages are suppressed.

fuzzy

logical. Defaults to TRUE to deal with misspelled names. May produce wrong assignments in case of very similar taxon names. If FALSE (default), names are only resolved to exactly matching taxa on GBIF taxonomy service.

conf_threshold

numerical, ranging from 0 to 100 (default value = 90). Defines the confidence level of the request to be accepted. To cover for misspellings and errors, could go as low as 50.

resolve_synonyms

logical. If TRUE (default), user provided synonyms are mapped to the accepted names on GBIF taxonomy service.

Value

a data.frame mapping the user supplied names to the accepted taxon names and higher taxonomic information (kingdom, phylum, class, order, family, genus).

Details

The function relies on package 'taxize' by Scott Chamberlain. It uses the spell-checking and fuzzy matching algorithms provided by Global Names Resolver (taxize::gnr_resolve()) and forwards synonyms to the accepted names as provided by GBIF Backbone Taxonomy (taxize::get_gbif_id_()).

If 'synonym' is returned as TRUE, the user provided name has been identified as a synonym and was mapped to an accepted name.

The field confidence reports the confidence of the matching procedure performed by the function get_gbifid_() of the package 'taxize'. The taxonID is a globally valid URI that links to the taxon description of the GBIF backbone taxonomy.

Examples


get_gbif_taxonomy(c("Chorthippus albomarginatus", "Chorthippus apricarius",
  "Chorthippus biguttulus", "Chorthippus dorsatus", "Chorthippus montanus",
  "Chorthippus parallelus", "Chrysochraon dispar", "Conocephalus dorsalis",
  "Conocephalus fuscus", "Decticus verrucivorus", "Euthystira brachyptera",
  "Gomphocerippus rufus", "Gryllus campestris", "Metrioptera roeselii",
  "Omocestus viridulus", "Phaneroptera falcata", "Platycleis albopunctata",
  "Spec", "Stenobothrus lineatus", "Stenobothrus stigmaticus",
  "Stethophyma grossum", "Tetrix kraussi", "Tetrix subulata",
  "Tetrix tenuicornis", "Tetrix undulata", "Tettigonia cantans",
  "Tettigonia viridissima")
  )
#>        verbatimScientificName synonym               scientificName
#> 1  Chorthippus albomarginatus   FALSE   Chorthippus albomarginatus
#> 2      Chorthippus apricarius   FALSE       Chorthippus apricarius
#> 3      Chorthippus biguttulus   FALSE       Chorthippus biguttulus
#> 4        Chorthippus dorsatus   FALSE         Chorthippus dorsatus
#> 5        Chorthippus montanus   FALSE                         <NA>
#> 6      Chorthippus parallelus    TRUE Pseudochorthippus parallelus
#> 7         Chrysochraon dispar   FALSE          Chrysochraon dispar
#> 8       Conocephalus dorsalis   FALSE        Conocephalus dorsalis
#> 9         Conocephalus fuscus   FALSE          Conocephalus fuscus
#> 10      Decticus verrucivorus   FALSE        Decticus verrucivorus
#> 11     Euthystira brachyptera   FALSE       Euthystira brachyptera
#> 12       Gomphocerippus rufus   FALSE         Gomphocerippus rufus
#> 13         Gryllus campestris   FALSE           Gryllus campestris
#> 14       Metrioptera roeselii    TRUE          Roeseliana roeselii
#> 15        Omocestus viridulus   FALSE          Omocestus viridulus
#> 16       Phaneroptera falcata   FALSE         Phaneroptera falcata
#> 17    Platycleis albopunctata   FALSE      Platycleis albopunctata
#> 18                       Spec   FALSE                         <NA>
#> 19      Stenobothrus lineatus   FALSE        Stenobothrus lineatus
#> 20   Stenobothrus stigmaticus   FALSE     Stenobothrus stigmaticus
#> 21        Stethophyma grossum   FALSE          Stethophyma grossum
#> 22             Tetrix kraussi   FALSE               Tetrix kraussi
#> 23            Tetrix subulata   FALSE              Tetrix subulata
#> 24         Tetrix tenuicornis   FALSE           Tetrix tenuicornis
#> 25            Tetrix undulata   FALSE              Tetrix undulata
#> 26         Tettigonia cantans   FALSE           Tettigonia cantans
#> 27     Tettigonia viridissima   FALSE       Tettigonia viridissima
#>                 author   taxonRank confidence  kingdom     phylum   class
#> 1      (De Geer, 1773)     species         99 Animalia Arthropoda Insecta
#> 2     (Linnaeus, 1758)     species         97 Animalia Arthropoda Insecta
#> 3     (Linnaeus, 1758)     species         97 Animalia Arthropoda Insecta
#> 4  (Zetterstedt, 1821)     species         97 Animalia Arthropoda Insecta
#> 5                 <NA> highertaxon         NA     <NA>       <NA>    <NA>
#> 6  (Zetterstedt, 1821)     species         99 Animalia Arthropoda Insecta
#> 7       (Germar, 1834)     species         99 Animalia Arthropoda Insecta
#> 8    (Latreille, 1804)     species         97 Animalia Arthropoda Insecta
#> 9    (Fabricius, 1793)     species         97 Animalia Arthropoda Insecta
#> 10    (Linnaeus, 1758)     species         97 Animalia Arthropoda Insecta
#> 11      (Ocskay, 1826)     species         99 Animalia Arthropoda Insecta
#> 12    (Linnaeus, 1758)     species         99 Animalia Arthropoda Insecta
#> 13      Linnaeus, 1758     species         97 Animalia Arthropoda Insecta
#> 14   (Hagenbach, 1822)     species         99 Animalia Arthropoda Insecta
#> 15    (Linnaeus, 1758)     species         97 Animalia Arthropoda Insecta
#> 16        (Poda, 1761)     species         97 Animalia Arthropoda Insecta
#> 17       (Goeze, 1778)     species         97 Animalia Arthropoda Insecta
#> 18                <NA>     species         NA     <NA>       <NA>    <NA>
#> 19      (Panzer, 1796)     species         97 Animalia Arthropoda Insecta
#> 20      (Rambur, 1838)     species         97 Animalia Arthropoda Insecta
#> 21    (Linnaeus, 1758)     species         99 Animalia Arthropoda Insecta
#> 22        Saulcy, 1888     species         99 Animalia Arthropoda Insecta
#> 23    (Linnaeus, 1758)     species         97 Animalia Arthropoda Insecta
#> 24    (Sahlberg, 1891)     species         97 Animalia Arthropoda Insecta
#> 25     (Sowerby, 1806)     species         97 Animalia Arthropoda Insecta
#> 26     (Fuessly, 1775)     species         97 Animalia Arthropoda Insecta
#> 27    (Linnaeus, 1758)     species         99 Animalia Arthropoda Insecta
#>         order        family             genus               taxonomy
#> 1  Orthoptera     Acrididae       Chorthippus GBIF Backbone Taxonomy
#> 2  Orthoptera     Acrididae       Chorthippus GBIF Backbone Taxonomy
#> 3  Orthoptera     Acrididae       Chorthippus GBIF Backbone Taxonomy
#> 4  Orthoptera     Acrididae       Chorthippus GBIF Backbone Taxonomy
#> 5        <NA>          <NA>              <NA> GBIF Backbone Taxonomy
#> 6  Orthoptera     Acrididae Pseudochorthippus GBIF Backbone Taxonomy
#> 7  Orthoptera     Acrididae      Chrysochraon GBIF Backbone Taxonomy
#> 8  Orthoptera Tettigoniidae      Conocephalus GBIF Backbone Taxonomy
#> 9  Orthoptera Tettigoniidae      Conocephalus GBIF Backbone Taxonomy
#> 10 Orthoptera Tettigoniidae          Decticus GBIF Backbone Taxonomy
#> 11 Orthoptera     Acrididae        Euthystira GBIF Backbone Taxonomy
#> 12 Orthoptera     Acrididae    Gomphocerippus GBIF Backbone Taxonomy
#> 13 Orthoptera     Gryllidae           Gryllus GBIF Backbone Taxonomy
#> 14 Orthoptera Tettigoniidae        Roeseliana GBIF Backbone Taxonomy
#> 15 Orthoptera     Acrididae         Omocestus GBIF Backbone Taxonomy
#> 16 Orthoptera Tettigoniidae      Phaneroptera GBIF Backbone Taxonomy
#> 17 Orthoptera Tettigoniidae        Platycleis GBIF Backbone Taxonomy
#> 18       <NA>          <NA>              <NA> GBIF Backbone Taxonomy
#> 19 Orthoptera     Acrididae      Stenobothrus GBIF Backbone Taxonomy
#> 20 Orthoptera     Acrididae      Stenobothrus GBIF Backbone Taxonomy
#> 21 Orthoptera     Acrididae       Stethophyma GBIF Backbone Taxonomy
#> 22 Orthoptera    Tetrigidae            Tetrix GBIF Backbone Taxonomy
#> 23 Orthoptera    Tetrigidae            Tetrix GBIF Backbone Taxonomy
#> 24 Orthoptera    Tetrigidae            Tetrix GBIF Backbone Taxonomy
#> 25 Orthoptera    Tetrigidae            Tetrix GBIF Backbone Taxonomy
#> 26 Orthoptera Tettigoniidae        Tettigonia GBIF Backbone Taxonomy
#> 27 Orthoptera Tettigoniidae        Tettigonia GBIF Backbone Taxonomy
#>                                taxonID
#> 1  http://www.gbif.org/species/1708567
#> 2  http://www.gbif.org/species/1708601
#> 3  http://www.gbif.org/species/1708251
#> 4  http://www.gbif.org/species/1708512
#> 5                                 <NA>
#> 6  http://www.gbif.org/species/7792296
#> 7  http://www.gbif.org/species/1700841
#> 8  http://www.gbif.org/species/1683331
#> 9  http://www.gbif.org/species/1683067
#> 10 http://www.gbif.org/species/1690685
#> 11 http://www.gbif.org/species/1701343
#> 12 http://www.gbif.org/species/1700023
#> 13 http://www.gbif.org/species/1716462
#> 14 http://www.gbif.org/species/4402879
#> 15 http://www.gbif.org/species/1710755
#> 16 http://www.gbif.org/species/1686243
#> 17 http://www.gbif.org/species/1685298
#> 18                                <NA>
#> 19 http://www.gbif.org/species/1710962
#> 20 http://www.gbif.org/species/1710986
#> 21 http://www.gbif.org/species/1711091
#> 22 http://www.gbif.org/species/9055856
#> 23 http://www.gbif.org/species/1681124
#> 24 http://www.gbif.org/species/1681181
#> 25 http://www.gbif.org/species/1681247
#> 26 http://www.gbif.org/species/8347376
#> 27 http://www.gbif.org/species/1692898
#>                                                  warnings
#> 1                                                        
#> 2                                                        
#> 3                                                        
#> 4                                                        
#> 5                           No matching species concept! 
#> 6   A synonym was mapped to the accepted species concept!
#> 7                                                        
#> 8                                                        
#> 9                                                        
#> 10                                                       
#> 11                                                       
#> 12                                                       
#> 13                                                       
#> 14  A synonym was mapped to the accepted species concept!
#> 15                                                       
#> 16                                                       
#> 17                                                       
#> 18          Check spelling or lower confidence threshold!
#> 19                                                       
#> 20                                                       
#> 21                                                       
#> 22                                                       
#> 23                                                       
#> 24                                                       
#> 25                                                       
#> 26                                                       
#> 27                                                       

get_gbif_taxonomy("Vicia")
#>   verbatimScientificName synonym scientificName author taxonRank confidence
#> 1                  Vicia   FALSE          Vicia     L.     genus         94
#>   kingdom       phylum         class   order   family genus
#> 1 Plantae Tracheophyta Magnoliopsida Fabales Fabaceae Vicia
#>                 taxonomy                             taxonID warnings
#> 1 GBIF Backbone Taxonomy http://www.gbif.org/species/2974751