Plots a phylogeny with tip labels colored to indicate continuous or discrete trait values
color.plot.phylo(phylo, df, trait, taxa.names,
num.breaks = ifelse(is.factor(df[,trait]),
length(levels(df[,trait])), 12),
col.names = rainbow(ifelse(length(num.breaks) > 1,
length(num.breaks) - 1, num.breaks)),
cut.labs = NULL,
leg.title = NULL,
main = trait,
leg.cex = 1,
tip.labs = NULL,
...)
An object of class phylo
A dataframe containing the traits to be plotted
A string representing the name of column in the dataframe to be plotted
A string representing the name of column in the dataframe that contains the names of the taxa
For continuous traits, the number of bins to separate the data into
A vector of colors to use for tip labels
A title for the tip color legend
A main title for the plot
A main title for the plot
A main title for the plot
A main title for the plot
Additional argument to pass to the plot.phylo
function
The command is invoked for its side effect, a plot of the phylo
with tips colored based on trait
If if trait
is a factor then each level of the factor is plotted with the corresponding col.names
value (if length(num.breaks) > length(col.names)
colors are recycled.) If trait
is not a factor then it is assumed to be continuous and trait
is evenly divided into num.breaks
levels.