Learn R Programming

rphast (version 1.6.9)

plot.rate.matrix: Make a bubble plot of a transition matrix

Description

Make a bubble plot of a transition matrix

Usage

# S3 method for rate.matrix
plot(x, eq.freq = NULL, max.cex = 10,
  eq.freq.max.cex = 5, alphabet = NULL, col = NULL, eq.freq.col = NULL,
  filled = TRUE, add = FALSE, ...)

Arguments

x

A square matrix representing a continuous-time markov model; rows should sum to zero, with negative values cross the diagonal

eq.freq

A numeric vector giving the equilibrium frequencies of each state. If provided, the equilibrium frequencies will be plotted along the bottom.

max.cex

A scaling factor which determines the size of the largest circle

eq.freq.max.cex

A scaling factor which determines the size of the largest circle in the equilibrium frequencies.

alphabet

A character vector representing the state names for each row/column of the matrix. Can either be a vector of size nrow(m) or a single character string with nrow(m) characters. Can also be NULL for no row/column labels.

col

If NULL, all circles will be drawn in black. Otherwise, col can be a matrix of the same dimension of m, each entry should indicate the color used for the corresponding cell in the transition matrix.

eq.freq.col

(Only applicable when eq.freq provided). Should be vector of same length as eq.freq, though values will be recycled. Values in the vector indicate colors to draw the equilibrium frequency bubbles.

filled

If TRUE, plot filled circles.

add

If TRUE, add to the existing plot. Otherwise create a new plot.

...

Further arguments to be passed to plot.