Description Usage Arguments Value Examples
View source: R/07_miscellaneous.R
Converts a symmetrical distance matrix to a tree and saves it in newick
format. Uses hclust
to form clusters.
1 | exportTree(getColorDistanceMatrixObject, file, return.tree = FALSE)
|
getColorDistanceMatrixObject |
A distance matrix, especially as returned
by |
file |
Character vector of desired filename for saving tree. Should end in ".newick". |
return.tree |
Logical. Should the tree object be returned to the working environment in addition to being saved as a file? |
Newick tree saved in specified location and as.phylo
tree
object if return.tree=TRUE
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
clusterList <- colordistance::getHistList(dir(system.file("extdata",
"Heliconius/", package="colordistance"), full.names=TRUE), lower=rep(0.8, 3),
upper=rep(1, 3))
CDM <- colordistance::getColorDistanceMatrix(clusterList, method="emd",
plotting=FALSE)
# Tree is both saved in current working directory and stored in
# heliconius_tree variable
heliconius_tree <- colordistance::exportTree(CDM,
"./HeliconiusColorTree.newick", return.tree=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.