Learn R Programming

simba (version 0.3-4)

boxes: Adaption of boxplot.n.

Description

boxes uses boxplot to produce a boxplot, which is then annotated with the number of obbservations in each group. Does allow for more flexibility compared to boxplot.n. Default size of the text is bigger and per default the numbers are not plotted directly on the x-axis and their distance from the axis can be changed.batons uses boxplot to create batonplots which give the same information but take up less space.

Usage

boxes(..., top = FALSE, shrink = 1, textcolor = NULL, yadj = NULL)

batons(...)

Arguments

...
Parameters passed to boxplot. To obtain batons the following boxplot-arguments are defined within the function and cannot changed by the user: boxwex=0, medpch=19
top
Should the numbers of observations be printed below or above the boxes? Defaults to below (top = FALSE).
shrink
Parameter to scale the size of the numbers of observations. Above 1 increases size, below 1 until 0 decreases size.
textcolor
Color of the text. Defaults to NULL which than uses the actual plotting colour of the graphics device.
yadj
Can be used to adjust the vertical plotting positions of the numbers of observations. Defaults to NULL - no adjustment.

encoding

UTF-8

See Also

boxplot, plot, boxplot.n

Examples

Run this code
data(abis)

## see environmental data (see documentation on data for details)
abis.env

## calculate the difference in similarities for the three major  
## vegetation types
## therefore created a vector from the data expressing belonging
## to the vegetation types:
tcs.sub <- rep(0, 61)
tcs.sub[abis.env[,29]==1] <- 1
tcs.sub[abis.env[,30]==1] <- 2
tcs.sub[abis.env[,31]==1] <- 3

## calculate similarity (Jaccard) between all pairs of plots
abis.jacc <- sim(abis.spec, method="jaccard")

## make boxplots regarding the similarities for each vegetation
## type, including the number of pairs contained in each box.
boxes(as.matrix(abis.jacc)~tcs.sub, shrink=1.2)

## prettier
boxes(as.matrix(abis.jacc)~tcs.sub, notch=TRUE, col="grey50", 
shrink=1.2, ylim=c(-0.1, 0.9))

## make batonplots
batons(as.matrix(abis.jacc)~tcs.sub)

Run the code above in your browser using DataLab