plot.comparative.comm | R Documentation |
Dot-plots of community presence/absence or abundance
## S3 method for class 'comparative.comm' plot( x, sites = NULL, abundance = FALSE, pch = 20, dot.cex = NULL, site.col = "black", fraction = 3, x.increment = NULL, show.tip.label = FALSE, ... )
x |
|
sites |
names of sites to plot (default: all); see examples |
abundance |
make size proportional to species abundance (default: FALSE) |
pch |
plotting character to be used for sites (see
|
dot.cex |
function to determine point size; see examples, this isn't as terrible-sounding as it seems. |
site.col |
colours to use when plotting sites; if not same length as number of sites, only the first element is used (no recycling) |
fraction |
fraction of plot window to be taken up with phylogeny; e.g., 3 (default) means phylogeny is 1/3 of plot |
x.increment |
specify exact spacing of points along plot; see examples |
show.tip.label |
whether to plot species names on phylogeney
(default: |
... |
additional arguments passed to plotting functions |
Take a look at the examples: this is (hopefully!) a lot
more straightforward than it might seem. Getting the right spacing
of dots on the phylogeny may take some playing around with the
fraction
and x.increment
arguments. It may seem a
little strange to set point size using a function, however, this
gives you much more flexibility and the ability to (usefully)
transform your data.
List containing plot.phylo information, as well as the used
x.adj values (compare with your x.increment
)
Will Pearse, Matt Helmus
comparative.comm
traitgram.cc
data(laja) data <- comparative.comm(invert.tree, river.sites, invert.traits) plot(data) plot(data, sites=c("AT", "BP"), fraction=1.5) settings <- plot(data, sites=c("AT", "BP"), site.col=rainbow(2), fraction=1.5) plot(data, sites=c("AT", "BP"), site.col=rainbow(2), fraction=1.2, x.increment=settings$x.increment/4) #dot.cex isn't as scary as it sounds... plot(data, site.col=rainbow(2), fraction=1.2, abundance=TRUE, dot.cex=sqrt) #...or other trivial variants... abund.sqrt <- function(x) ifelse(x>0, sqrt(x), 0) plot(data, sites=c("AT", "BP"), site.col=rainbow(2), fraction=1.2, x.increment=settings$x.increment/4, abundance=TRUE, dot.cex=abund.sqrt) plot(data, sites=c("AT", "BP"), site.col=rainbow(2), fraction=1.2, x.increment=settings$x.increment/4, abundance=TRUE, dot.cex=function(x) sqrt(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.