# NOT RUN {
## the tree by Nyakatura & Bininda-Emonds (2012, BMC Biology)
x <- "https://static-content.springer.com/esm/art"
y <- "3A10.1186"
z <- "2F1741-7007-10-12/MediaObjects/12915_2011_534_MOESM5_ESM.NEX"
## The commande below may not print correctly in HTML because of the
## percentage symbol; see the text or PDF help page.
url <- paste(x, y, z, sep = "<!-- %") -->
TC <- read.nexus(url)
tr <- TC$carnivoreST_bestEstimate
old <- c("Uncia_uncia", "Felis_manul", "Leopardus_jacobitus")
new <- c("Panthera_uncia", "Otocolobus_manul", "Leopardus_jacobita")
tr.updated <- updateLabel(tr, old, new)
# }
# NOT RUN {
tr <- rtree(6)
## the order of the labels are randomized by this function
old <- paste0("t", 1:6)
new <- paste0("x", 1:6)
updateLabel(tr, old, new)
tr
# }
Run the code above in your browser using DataLab