Learn R Programming

taxotools (version 0.0.139)

synonymize_subspecies: Convert all subspecies into synonyms of the species

Description

used in generating master lists

Usage

synonymize_subspecies(master, return_unmatched = FALSE, verbose = TRUE)

Value

Same list of names with id and accid fields added (or data updated the fields exists) with all subspecies linked to the species names as synonyms

Arguments

master

List of names with a field named canonical

return_unmatched

If the return values should be unmatched (orphan) subspecies records. Default: FALSE

verbose

display process messages, Default: TRUE

Details

While dealing with taxonomic names only at species level, to take advantage of sub-specific names already available in the lists are sometimes treated as synonyms of the names at species rank. To convert all the subspecies names as synonyms this function is very handy. This function will add id, accid and taxonrank columns ro return data if missing from original data.

See Also

Other List functions: DwC2taxo(), cast_cs_field(), compact_ids(), get_synonyms(), match_lists(), melt_cs_field(), merge_lists(), syn2taxo(), taxo2DwC(), taxo2doc(), taxo2syn(), wiki2taxo()

Examples

Run this code
# \donttest{
master <- data.frame("id" = c(1,2,3,4,5,6,7),
                    "canonical" = c("Hypochlorosis ancharia",
                                     "Hypochlorosis tenebrosa",
                                     "Pseudonotis humboldti",
                                     "Myrina ancharia ancharia",
                                     "Hypochlorosis ancharia tenebrosa",
                                     "Hypochlorosis ancharia obiana",
                                     "Hypochlorosis lorquinii"),
                     "family" = c("Lycaenidae", "Lycaenidae", "Lycaenidae",
                                  "Lycaenidae", "Lycaenidae", "Lycaenidae",
                                  "Lycaenidae"),
                     "accid" = c(0,1,1,0,0,0,0),
                     "source" = c("itis","itis","wiki","wiki","itis",
                                  "itis","itis"),
                     stringsAsFactors = FALSE)

synonymize_subspecies(master)
synonymize_subspecies(master,return_unmatched = TRUE)
# }

Run the code above in your browser using DataLab