Learn R Programming

Claddis (version 0.3.4)

PlotCharacterChanges: Plots character changes on branches

Description

Plots character changes in boxes on branches.

Usage

PlotCharacterChanges(character.changes, tree)

Arguments

character.changes

A matrix of character changes.

tree

Tree on which character changes occur.

Value

A plot of character changes on a tree.

Details

Takes the character.changes output from DiscreteCharacterRate and plots it on the tree used to generate it.

Examples

Run this code
# NOT RUN {
# Set random seed:
set.seed(17)

# Generate a random tree for the Michaux data set:
tree <- rtree(nrow(Michaux1989$Matrix_1$Matrix))

# Update taxon names to match those in the data matrix:
tree$tip.label <- rownames(Michaux1989$Matrix_1$Matrix)

# Set root time by making youngest taxon extant:
tree$root.time <- max(diag(vcv(tree)))

# Get discrete character rates (includes changes):
out <- DiscreteCharacterRate(tree, Michaux1989,
  seq(tree$root.time, 0, length.out = 3),
  BranchPartitionsToTest = list(list(1)), Alpha = 0.01)

# Plot character changes on the tree:
PlotCharacterChanges(out$InferredCharacterChanges,
  tree)

# }

Run the code above in your browser using DataLab