Learn R Programming

taxotools (version 0.0.139)

syn2taxo: Synonym list to taxolist

Description

Converts a Synonym list with Accepted Names and Synonym columns to taxolist format

Usage

syn2taxo(synlist, canonical = "canonical", synonym = "synonym")

Value

returns a data frame in taxolist format with all the names in canonical column and accepted names linked to synonyms using id and accid fields. Order, family and (guessed) taxonlevel are added if missing. Genus, species and subspecies fields are added by melting the canonical names.

Arguments

synlist

Synonym list with Accepted name (canonical) and Synonym columns

canonical

Accepted names column name, Default: 'canonical'

synonym

Synonym column name , Default: 'synonym'

Details

Converts a synonyms list to taxolist format. If order and family fields are present, then they are carried forward else NAs are populated. Duplicate synomyms with same source are removed but with different sources are retained.

See Also

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

Examples

Run this code
# \donttest{
 synlist <- data.frame("id" = c(1,2,3),
                       "canonical" = c("Hypochlorosis ancharia",
                                       "Hypochlorosis ancharia",
                                       "Hypochlorosis ancharia"),
                       "synonym" = c( "Hypochlorosis tenebrosa",
                                      "Pseudonotis humboldti",
                                      "Myrina ancharia"),
                       "family" = c("Lycaenidae", "Lycaenidae", 
                                    "Lycaenidae"),
                       "source" = c("itis","wiki","wiki"),
                       stringsAsFactors = FALSE)
                       
 mytaxo <- syn2taxo(synlist)
# }

Run the code above in your browser using DataLab