3 \alias{makeLabel.character}
4 \alias{makeLabel.phylo}
5 \alias{makeLabel.multiPhylo}
6 \alias{makeLabel.DNAbin}
7 \title{Label Management}
10 \method{makeLabel}{character}(x, len = 99, space = "_", make.unique = TRUE,
11 illegal = "():;,[]", quote = FALSE, ...)
12 \method{makeLabel}{phylo}(x, tips = TRUE, nodes = TRUE, ...)
13 \method{makeLabel}{multiPhylo}(x, tips = TRUE, nodes = TRUE, ...)
14 \method{makeLabel}{DNAbin}(x, ...)
17 \item{x}{a vector of mode character or an object for which labels are
19 \item{len}{the maximum length of the labels: those longer than `len'
21 \item{space}{the character to replace spaces, tabulations, and
23 \item{make.unique}{a logical specifying whether duplicate labels
24 should be made unique by appending numerals; \code{TRUE} by
26 \item{illegal}{a string specifying the characters to be deleted.}
27 \item{quote}{a logical specifying whether to quote the labels;
28 \code{FALSE} by default.}
29 \item{tips}{a logical specifying whether tip labels are to be
30 modified; \code{TRUE} by default.}
31 \item{nodes}{a logical specifying whether node labels are to be
32 modified; \code{TRUE} by default.}
33 \item{...}{further arguments to be passed to or from other methods.}
36 This is a generic function with methods for character vectors, trees
37 of class \code{"phylo"}, lists of trees of class \code{"multiPhylo"},
38 and DNA sequences of class \code{"DNAbin"}. All options for the class
39 character may be used in the other methods.
42 The option \code{make.unique} does not work exactly in the same way
43 then the function of the same name: numbers are suffixed to all labels
44 that are identical (without separator). See the examples.
46 If there are 10--99 identical labels, the labels returned are "xxx01",
47 "xxx02", etc, or "xxx001", "xxx002", etc, if they are 100--999, and so
48 on. The number of digits added preserves the option `len'.
50 The default for `len' makes labels short enough to be read by
51 PHYML. Clustal accepts labels up to 30 character long.
54 The current version does not perform well when trying to make very
55 short unique labels (e.g., less than 5 character long).
58 An object of the appropriate class.
60 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
62 \code{\link[base]{make.unique}}, \code{\link[base]{make.names}},
63 \code{\link[base]{abbreviate}}
68 make.unique(x) # <- from R's base
70 makeLabel(x, len = 3) # made unique and of length 3
71 makeLabel(x, len = 3, make.unique = FALSE)