Learn R Programming

amap (version 0.5-1)

hc2Newick: Convert hclust objects to Newick format files

Description

Convert hclust objects to Newick format files.

Usage

hc2Newick(hc, flat=TRUE)

Arguments

Value

If flat=TRUE the result is a string (that you can write in a file).

If flat=FALSE the result is a list (of lists). Each list is consituted of the elements left, right and dist.

Examples

Run this code
data(USArrests)
h = hclust(dist(USArrests))
write(hc2Newick(h),file='hclust.newick')

Run the code above in your browser using DataLab