rectangles: Plot Matrix Dimensions

Description Usage Arguments Details Value Note Author(s) Examples

Description

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

Usage

1
2
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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)

vegsoup documentation built on Feb. 24, 2021, 3 a.m.