append2tips: Append Symbols or Text to Tip Labels

Description Usage Arguments Details See Also Examples

Description

Add text or symbols to the tip labels of a phylogenetic tree.

Usage

1
2
3
append2tips(phy, tips, offset, align = FALSE, grid = FALSE,
  col = "red", text = NULL, pch = NULL, cex, legend,
  legend.srt = 90, legend.cex = cex, ...)

Arguments

phy

An object of class phylo.

tips

A vector of mode "numeric", giving the tip numbers to which append text or symbols. If missing, all tips are used.

offset

Used to control the distance of text or symbols from the tips of the phylogenetic tree. Can either be of mode "numeric" or "character". In the latter case the width of the string is calculated and used as offset.

align

Logical, if TRUE text or symbols will be aligned.

grid

Logial, if TRUE dotted lines are plotted as a horizontal grid to aid visual orientation.

col

A character string, giving the color for text or symbols.

text

A character string, providing text to be appended to the tip labels.

pch

An integer, specifying the symbol used (see points).

cex

A real number, giving the character expension (see par). If missing, cex is taking from the previous call of plot.phylo.

legend

A character string to be used as a column legend.

legend.srt

A vector of mode "numeric" to rotate legend.

legend.cex

A real number, giving the character expension for the legend.

...

Further graphical parameters (from par), such as srt, family and xpd.

Details

Currently, append2tips is will work only for plot.phylo using types "phylogram" or "cladogram" and directions "rightwards" or "leftwards".

See Also

plot.phylo, tiplabels, mixedFontBinom

Examples

 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
41
42
# phylogeny of true vipers
# ------------------------
#data(viperidae)
#plot.phylo(viperidae, cex = 0.9, label.offset = 0.01)

# append geographical origin of accessions:
# -----------------------------------------
#txt <- origin[, 2]
#append2tips(viperidae, text = txt)

# If the appended labels - like in the example above -
# exceed the plotting region, a warning is issued and it
# is suggested a new value for x.lim:
# -----------------------------------
#plot.phylo(viperidae, cex = 0.9, label.offset = 0.01, x.lim = 1.1)
#append2tips(viperidae, text = txt)

# a lot of combinations are possible:
# -----------------------------------
#plot.phylo(viperidae, cex = 0.8, label.offset = 0.02, x.lim = 1.5)
#NTips <- length(viperidae$tip.label)
#append2tips(viperidae, text =
#	paste("A", 1:NTips, sep = "-"), col = "orange")
#append2tips(viperidae, tips <- c(5, 7:9, 14),
#	text = rep("xxx", 5), col = "slateblue")
#append2tips(viperidae, pch = 23, col = rainbow(NTips))
#append2tips(viperidae, pch = 21, col = "grey50",
#   align = TRUE, grid = TRUE)

# ... it also works when actual tip labels are omitted:
# -----------------------------------------------------
#plot.phylo(viperidae, show.tip.label = FALSE, x.lim = 40,
#	cex = 0.8, type = "clado", use.edge.length = FALSE)
#txt <- origin[, 2]
#append2tips(viperidae, text = txt)

# ... it can be combined with taxo.fonts:
# -----------------------------------------------------
#plot.phylo(viperidae, show.tip.label = FALSE, x.lim = 1.5)
#taxo.fonts(viperidae)
#txt <- origin[, 2]
#append2tips(viperidae, text = txt, offset = 0.1, grid = TRUE)

heibl/viper documentation built on May 21, 2019, 10:47 a.m.