merge_lists | R Documentation |
Useful in generating a master list of names from multiple sources
merge_lists(master = NULL, checklist = NULL, output = "all", verbose = TRUE)
master |
master list of names |
checklist |
list to be merged |
output |
data returned by the function, one of the five options all, onlyadd, add, merged, new or multi. Default all |
verbose |
verbose output on the console |
Matches names is checklist with names on master and returns following data:
= orig + add + new + multi: all the data
= add : returns records from checklist that match with master
= orig + add : returns all records from master + matched records from checklist
= orig + add + new : returns all records from master + matched records from checklist + new taxon from checklist
= returns only new taxon entities that did not match with master
= taxon from checklist for which two synonyms matched with two different accepted names in master
Data frame with addition column merge_tag. The merge_tag contains four possible values.
names in the master
checklist names that matched using synonym linkages including direct matches
checklist names that did NOT match with master. Potentially new taxa
taxon from checklist for which two synonyms matched with two different accepted names in master
Other List functions:
DwC2taxo()
,
cast_cs_field()
,
compact_ids()
,
get_synonyms()
,
match_lists()
,
melt_cs_field()
,
syn2taxo()
,
synonymize_subspecies()
,
taxo2DwC()
,
taxo2doc()
,
taxo2syn()
,
wiki2taxo()
master <- data.frame("id" = c(1,2,3),
"canonical" = c("Hypochlorosis ancharia",
"Hypochlorosis tenebrosa",
"Hypochlorosis ancharia tenebrosa"),
"family" = c("Lycaenidae", "Lycaenidae", "Lycaenidae"),
"accid" = c(0,1,0),
"source" = c("itis","itis","itis"),
stringsAsFactors = FALSE)
checklist <- data.frame("id" = c(1,2,3,4,5),
"canonical" = c("Hypochlorosis ancharia",
"Pseudonotis humboldti",
"Myrina ancharia",
"Hypochlorosis ancharia obiana",
"Hypochlorosis lorquinii"),
"family" = c("Lycaenidae", "Lycaenidae",
"Lycaenidae", "Lycaenidae",
"Lycaenidae"),
"accid" = c(0,1,1,0,0),
"source" = c("itis","wiki","wiki","itis",
"itis"),
stringsAsFactors = FALSE)
merged_all <- merge_lists(master,checklist,output="all")
new_taxa <- merge_lists(master,checklist,output="new")
merged_with_new <- merge_lists(master,checklist,output="merged")
merged_add <- merge_lists(master,checklist,output="add")
multi_linked <- merge_lists(master,checklist,output="multi")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.