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