bplot {funfits}R Documentation

boxplot

Description

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-positions. This is useful for visually grouping a large set of boxplots into several groups. Also placement of the boxplots with respect to the x-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.

Finally it should be noted that this function constructs the boxplots based on percentiles of the data rather than using the hinge and fence arcana from EDA. This is probably heretical to some but it makes it much easier to teach undergraduate students what these are!

The function is simple enough so that one _could_ hingeify the boxes. Also it would be simple to modify this function to get boxes horizontally instead of vertically.

Usage

bplot(x, ..., xpos=NA, width, label, by, srt=0, add=F, space=0.25, sort.names=T, xlab="", ylab="")

Arguments

x Vector, matrix, list or data frame
... Additional data sets to be plotted.
xpos The boxes will be plotted vertically and xpos gives the x locations for their centers. If omitted the boxes are equally spaced at integer values.
width Width of boxplots if omitted then the width is a reasonable fraction of the distance between boxes and is set by the space argument.
label Labels under each boxplot. If missing the columns names or components of x are used.
by If x is a vector a vector of categories that will be used to split the x values into separate groups. Of course box plots will be made of the groups.
srt Rotate the labels. Default is to put them horizontal.
add Do not create a new plots just add the boxplots to a current plot. Note that the xpos argument may be useful in this case.
space Space between boxplots.
sort.names Plot the boxplots sorted in alphabetic order by their labels.
xlab Label for the x-axis
ylab Label for the y-axis

See Also

boxplot,lplot

Examples

# boxplots of the times for different events in a minitriathlon
bplot( minitri)
# some boxplots of uniform random sample with different power 
# transformations
temp<- runif(50)
bplot( temp, temp**1.5, temp**2, xpos=c(1,1.5,2.0), labels=c("uniform","1.5 
power", "square") )  


[Package Contents]