write.hclust: Cut a hierarchical cluster tree and write cluster identifiers...

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/write.hclust.R

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

1
write.hclust(x, file, prefix, h = NULL, k = NULL, append = FALSE, dec = ",")

Arguments

x

object of class hclust: result of hierarchical cluster analysis computed via function hclust.

file

either a character string naming a file or a connection open for writing. "" indicates output to the console.

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 file is a character string. If TRUE, the output is appended to the file. If FALSE, any existing file of the name is destroyed.

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

write.table, cutree

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)

Example output

Loading required package: RColorBrewer

RFLPtools documentation built on May 4, 2021, 1:06 a.m.