Learn R Programming

fields (version 5.02)

bplot: boxplot

Description

Plots boxplots of several groups of data and allows for placement at different horizontal or vertical positions or colors. It is also flexible in the input object, accepting either a list or matrix.

Usage

bplot(x, by,style = "tukey", outlier = TRUE, plot = TRUE, ...)

Arguments

Details

This function was created as a complement to the usual S function for boxplots. The current function makes it possible to put the boxplots at unequal x or y positions. This is useful for visually grouping a large set of boxplots into several groups. Also placement of the boxplots with respect to the axis can add information to the plot. Another aspect is the emphasis on data structures for groups of data. One useful feature is the by option to break up the x vector into distinct groups. If 5 or less observations are in a group the points themselves are plotted instead of a box.

The function is broken into two steps: a call to stats.bplot to find the statistics and a call to bplot.obj to plot the resulting object. The user is referred to describe.bplot to modify the statistics used and to draw.bplot.obj to modify how the bplot is drawn.

Finally to bin data into groups based on a continuous variable and to make bplots of each group see bplot.xy.

See Also

describe.bplot, draw.bplot.obj, stats.bplot, bplot.xy, bplot.obj

Examples

Run this code
#
set.seed(123)
temp<- matrix( rnorm(12*8), ncol=12)
pos<- c(1:6,9:14)
bplot(temp)
#
bplot( temp, pos=pos, labels=paste( "D",1:12), horizontal=TRUE)
#
# boxplots in red
bplot( temp, pos=pos, label.cex=0, horizontal=TRUE, col="red")
# add an axis
axis( 2)

Run the code above in your browser using DataLab