# \donttest{
mylist <- 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)
mylist_c <- compact_ids(mylist)
mylist_c <- compact_ids(mylist,startid=1001)
mylist <- data.frame("id" = c(11,12,13,14,15),
"canonical" = c("Hypochlorosis ancharia",
"Pseudonotis humboldti",
"Myrina ancharia",
"Hypochlorosis ancharia obiana",
"Hypochlorosis lorquinii"),
"family" = c("Lycaenidae", "Lycaenidae",
"Lycaenidae", "Lycaenidae",
"Lycaenidae"),
"accid" = c(0,11,11,0,0),
"source" = c("itis","wiki","wiki","itis",
"itis"),
stringsAsFactors = FALSE)
mylist_c <- compact_ids(mylist)
# }
Run the code above in your browser using DataLab