Description Usage Arguments Details Value Note Author(s) See Also Examples
getTree is a convenience function to extract parts from the Glottolog 2016 data as provided here in glottolog
.
1 |
up |
a vector of names from which to extract the tree upwards. Can be names from Glottolog, ISO 639-3 codes, WALS codes or glottocodes. Default settings expect ISO 639-3 codes. |
kind |
what kind of names are specified in |
down |
a vector of family names from Glottolog from which to extract the tree downwards. For consistency, a node "World" as added on top, linking separate families. Specifying families that are part of other families in |
reduce |
remove all nodes in the tree that do not branch. |
Specifying both up
and down
will extract only the intersection of the two. So any name in up
that lies outside any family in down
will be discarded.
Returns a data.frame with the relevant lines from the full glottolog data.
This function is hard-coded to only use the data as available in glottolog
.
Michael Cysouw <cysouw@mac.com
asPhylo
for tweaking branch lengths in phylo conversion.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # 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) )
## Not run:
# 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 = T)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.