edge.color: Colors for Tips and Edges in Phylogenies

Description Usage Arguments Value Author(s) See Also Examples

Description

This functions create vectors with color names that can be used as input for the tip.color and edge.color arguments of plot.phylo from the ape package.

Usage

1
2
3
tip.color(phy, tips, regex = FALSE, col, bgcol)

edge.color(phy, groups, what = "crown", col, bgcol)

Arguments

phy

an object of class phylo.

groups

vector, matrix, or list, giving the groups, either monophyletic or not, whose edges will be colored. The elements of groups may be of mode numeric or character, representing tip numbers or tip labels.

tips

a vector or list of mode character, giving the tip labels to be colored.

regex

logical: if true, all elements of tips are interpreted as regular expressions. regex = FALSE corresponds to fixed = TRUE in grep.

bgcol

a character string, giving the default color, i.e. the color for those edges and tips not present in groups or tips.

col

a vector of mode character, containing the colors to be used, will be recycled.

what

a character string, indicating whether the stem lineage of a clade shall be included (what = "stem") or not (what = "crown").

Value

a vector of mode character.

Author(s)

Christoph Heibl

See Also

plot.phylo for plotting of phylogenies; clade.bars, box.clades, and box.tips for high-lighting clades in phylogenies; taxo.fonts for setting nomenclaturally proper tip labels.

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
# phylogentic relationships of bird orders:
data(bird.orders)

## 1. EXAMPLE: three monophyletic clades
## -------------------------------------

# define clades:
clades <- list(1:5, 8:12, 13:23)
	
# generate edge colors:
mycols <- c("orange", "purple", "blue")
ecol <- edge.color(bird.orders, clades, col = mycols)

# plot tree:
plot(bird.orders, edge.color = ecol,
  no.margin = TRUE, edge.width = 2)

## 2. EXAMPLE: depict patristic distance between two tips
## ------------------------------------------------------

group <- c("Strigiformes", "Piciformes")
ecol <- edge.color(bird.orders, group, col = "red")
tcol <- tip.color(bird.orders, group, col = "red")
plot(bird.orders, edge.color = ecol, tip.color = tcol,
  no.margin = TRUE, edge.width = 2)

fmichonneau/phyloch documentation built on May 16, 2019, 1:45 p.m.