write.hclust {RFLPtools} | R Documentation |
Cut a hierarchical cluster tree and write cluster identifiers to a text file.
Description
The tree obtained by a hierarchical cluster analysis is cut into
groups by using cutree
and the results are
exported to a text file.
Usage
write.hclust(x, file, prefix, h = NULL, k = NULL, append = FALSE, dec = ",")
Arguments
x |
object of class |
file |
either a character string naming a file or a connection open
for writing. |
prefix |
character. Information about the cluster analysis. |
h |
numeric scalar or vector with heights where the tree should be cut. |
k |
an integer scalar or vector with the desired number of groups. |
append |
logical. Only relevant if |
dec |
the string to use for decimal points in numeric or complex columns: must be a single character. |
Details
The results are written to file by a call to write.table
where the columns in the resulting file are seperated by tabulators
(i.e. sep="\t"
) and no row names are exported (i.e. row.names = FALSE
).
Author(s)
Fabienne Flessa Fabienne.Flessa@uni-bayreuth.de,
Alexandra Kehl Alexandra.Kehl@uni-tuebingen.de,
Matthias Kohl Matthias.Kohl@stamats.de
References
Flessa, F., Kehl, A., Kohl, M. Analysing diversity and community structures using PCR-RFLP: a new software application. Molecular Ecology Resources 2013 Jul; 13(4):726-33.
See Also
Examples
data(RFLPdata)
res <- RFLPdist(RFLPdata, nrBands = 4)
cl <- hclust(res)
## Not run:
write.hclust(cl, file = "Test.txt", prefix = "Bd4", h = 50)
## End(Not run)
res <- RFLPdist2(RFLPdata, nrBands = 4, nrMissing = 1)
cl <- hclust(res)
## Not run:
write.hclust(cl, file = "Test.txt", append = TRUE, prefix = "Bd4_Mis1", h = 60)
## End(Not run)