rectangles {vegsoup}R Documentation

Plot Matrix Dimensions

Description

Retrieves the number of species and sites for each partition and plots a box according to its dimension.

Usage

## S4 method for signature 'VegsoupPartition'
rectangles(obj, plot = TRUE, ...)

Arguments

obj

'VegsoupPartiton' object.

plot

If TRUE create a plot, otherwise just return a matrix of partition dimensions used to create boxes. Defaults to TRUE.

...

graphical parameters. See ‘Details’.

Details

A lying box indicates species poor and an upright box highlights species rich partitions. Currently graphical parameters can only be passed to rect. The functions adds a additional rug-like line to marking partitions that contain only one site. See argument polish in function VegsoupPartition to get rid of singletons in your analysis.

Value

Returns a matrix with two columns as returned by dim(obj[partitioning(obj) == i,]), where i is a specific partition. The first column shows number of plots and the second column shows number of species.

Note

Any warnings that typically arise when a single partition is subsetted from an object are silenced. These warnings are harmless and not of interest at this point.

Author(s)

Roland Kaiser

Examples

require(vegsoup)

data(windsfeld)
x <- VegsoupPartition(windsfeld, k = 20)

rectangles(x)
#   add color to the boxes
rectangles(x, col = rgb(0,0,0,0.2))
#   return matrix only
r <- rectangles(x, plot = FALSE)

# use polish = TRUE
x <- VegsoupPartition(windsfeld, k = 10, polish = TRUE)

#   add fancy colors to the boxes
require(RColorBrewer)
rectangles(x, plot = TRUE,
		   col = rgb(0,0,0,0.2),
		   border = RColorBrewer::brewer.pal(getK(x), "Spectral"),
		   lwd = 2)

[Package vegsoup version 0.2-9 Index]