Function to build a reference dataframe selecting a case for each taxon from the available specimens in the references' database.

AssembleReference(
  combination,
  ref.db = referencesDatabase,
  thesaurus = zoologThesaurus$taxon
)

Arguments

combination

A dataframe or named list. Each (column) name identifies a taxon. Each column or list element must have a single element of type character, identifying one of the sources included in the references' database.

ref.db

A reference database. This is a named list of named lists of dataframes. The first level is named by taxon and the second level is named by reference source. Each dataframe includes the reference for the corresponding taxon and source. The default ref.db = referencesDatabase is provided as package zoolog data.

thesaurus

A thesaurus for taxa.

Value

A reference dataframe.

Examples

## `referenceSets` includes a series of predefined reference compositions.
referenceSets
#>                     Bos taurus Bos primigenius Ovis aries Ovis orientalis
#> NietoDavisAlbarella      Nieto                      Davis                
#> Basel                    Basel                                      Basel
#> Combi                    Nieto                    Clutton                
#> Groningen                             Degerbol                   Uerpmann
#>                     Capra hircus Capra aegagrus Sus domesticus Sus scrofa
#> NietoDavisAlbarella                                  Albarella           
#> Basel                      Basel                                    Basel
#> Combi                    Clutton                                    Basel
#> Groningen                              Uerpmann                     Hongo
#>                     Cervus elaphus Dama mesopotamica Gazella gazella
#> NietoDavisAlbarella                                                 
#> Basel                        Basel                                  
#> Combi                        Basel             Haifa           Haifa
#> Groningen                                                           
#>                     Equus asinus Equus caballus Oryctolagus cuniculus
#> NietoDavisAlbarella                                                  
#> Basel                                                                
#> Combi                      Haifa      Johnstone            Nottingham
#> Groningen                                                            
#>                     Canis lupus
#> NietoDavisAlbarella            
#> Basel                          
#> Combi                   Russell
#> Groningen                      
## Actually the package `references` is build from them.
## We can rebuild any of them:
referenceCombi <- AssembleReference(referenceSets["Combi", ])

## Define an altenative reference combining differently the references'
## database:
refComb <- list(cattle = "Nieto", sheep = "Davis", Goat = "Clutton",
                pig = "Albarella", redDeer = "Basel")
userReference <- AssembleReference(refComb)