# use getTree() to select genealogical parts of the data
data(glottolog)
( aalawa <- getTree(up = "aala1237", kind = "glottocode") )
( kandas <- getTree(down = "Kandas-Duke of York") )
( treeFull <- getTree(up = c("deu", "eng", "ind", "cha"), kind = "iso") )
( treeReduced <- getTree(up = c("deu", "eng", "ind", "cha"), kind = "iso", reduce = TRUE) )
# \donttest{
# use FromDataFrameNetwork() to visualize the tree
# and export it into various other tree formats in R
library(data.tree)
treeF <- FromDataFrameNetwork(treeFull)
treeR <- FromDataFrameNetwork(treeReduced)
plot(treeF)
plot(treeR)
# turn into phylo format from library 'ape'
t <- as.phylo.Node(treeR)
plot(t)
# turn into dendrogram
t <- as.dendrogram(treeF)
plot(t, center = TRUE)
# }
Run the code above in your browser using DataLab