# \donttest{
master <- data.frame("id" = c(1,2,3,4,5,6,7),
"canonical" = c("Hypochlorosis ancharia",
"Hypochlorosis tenebrosa",
"Pseudonotis humboldti",
"Myrina ancharia",
"Hypochlorosis ancharia tenebrosa",
"Hypochlorosis ancharia obiana",
"Hypochlorosis lorquinii"),
"family" = c("Lycaenidae", "Lycaenidae", "Lycaenidae",
"Lycaenidae", "Lycaenidae", "Lycaenidae",
"Lycaenidae"),
"accid" = c(0,1,1,1,0,0,0),
"source" = c("itis","itis","wiki","wiki","itis",
"itis","itis"),
stringsAsFactors = FALSE)
mylist <- data.frame("id"= c(11,12,13,14,15,16,17,18,19),
"scname" = c("Hypochlorosis ancharia",
"Hypochlorosis ancharii",
"Hypochlorosis tenebrosa",
"Pseudonotis humboldtii",
"Abrothrix longipilis",
"Myrinana anchariana",
"Hypochlorosis ancharia ancharia",
"Myrina lorquinii",
"Sithon lorquinii"),
stringsAsFactors = FALSE)
res <- get_accepted_names(namelist = mylist,
master=master,
canonical = "scname")
gen_syn_list <- data.frame("Original_Genus"=c("Pseudonotis",
"Myrina"),
"Valid_Genus"=c("Hypochlorosis",
"Hypochlorosis"),
stringsAsFactors = FALSE)
res <- get_accepted_names(namelist = mylist,
master=master,
gen_syn = gen_syn_list,
canonical = "scname")
lookup_list <- data.frame("binomial"=c("Sithon lorquinii",
"Hypochlorosis humboldti"),
"validname"=c("Hypochlorosis lorquinii",
"Hypochlorosis lorquinii"),
stringsAsFactors = FALSE)
res <- get_accepted_names(namelist = mylist,
master=master,
gen_syn = gen_syn_list,
namelookup = lookup_list,
canonical = "scname")
mylist_s <- melt_canonical(mylist,canonical = "scname",
genus = "genus",
species = "species",
subspecies = "subspecies")
res <- get_accepted_names(namelist = mylist_s,
master=master,
gen_syn = gen_syn_list,
namelookup = lookup_list,
genus = "genus",
species = "species",
subspecies = "subspecies")
res <- get_accepted_names(namelist = mylist_s,
master=master,
gen_syn = gen_syn_list,
namelookup = lookup_list,
mastersource = c("itis"),
genus = "genus",
species = "species",
subspecies = "subspecies")
mylist <- data.frame("id"= c(11,12,13,14,15,16,17,18),
"scname" = c("Hypochlorosis ancharia",
"Hypochlorosis ancharii",
"Hypochlorosis",
"Pseudonotis",
"Lycaenidae",
"Pseudonotis humboldtii",
"Abrothrix longipilis",
"Myrinana anchariana"),
stringsAsFactors = FALSE)
res <- get_accepted_names(namelist = mylist,
master=master,
match_higher = TRUE,
canonical = "scname")
# }
Run the code above in your browser using DataLab