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 29 30 31 32 33 34 35 36 37 38 39 40
|
\name{hc2Newick}
\alias{hc2Newick}
\title{Convert hclust objects to Newick format files}
\description{
Convert hclust objects to Newick format files.
}
\usage{
hc2Newick(hc, flat=TRUE)
}
\arguments{
\item{hc}{a \code{hclust} object (as returned by the function \code{hclust}
in the package \code{stats})}
\item{flat}{a boolean (see section value).}
}
\value{
If \code{flat=TRUE} the result is a string (that you can write in a
file).
If \code{flat=FALSE} the result is a list (of lists). Each list
is consituted of the elements \code{left}, \code{right} and \code{dist}.
}
\examples{
data(USArrests)
h = hclust(dist(USArrests))
write(hc2Newick(h),file='hclust.newick')
}
\references{
Antoine Lucas and Sylvain Jasson, \emph{Using amap and ctc Packages
for Huge Clustering}, R News, 2006, vol 6, issue 5 pages 58-60.
}
\author{
Laurent (laurent@cbs.dtu.dk)
}
\keyword{manip}
\keyword{cluster}
|