bplot(x, by, pos=NULL, at = pos, add = FALSE, boxwex = 0.8,xlim=NULL, ...)
at
in the boxplot
function
pos
this is the name for this argument in the standard boxplot
function.boxplot
.
To make this a general function it is useful to scale this according to size of positions. Within bplot this happens as boxwex<- boxwex* min(diff( sort( at)))
.
and then the scaled version of boxwex
is now passed to boxplot
.names
Labels for each boxplot.
horizontal
If TRUE draw boxplots horizontally the default is false, produce
vertical box plots.
lwd
Width(s) of lines in box plots.
col
Color(s) of bplots. See colors()
for some choices.at
or
pos
arguments. 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.
The older bplot
function drew the boxplots from scratch and if
one needs to do this refer to the old functions:
describe.bplot, draw.bplot.obj, bplot.xy, bplot.obj
Finally to bin data into groups based on a continuous variable and to
make bplots of each group see bplot.xy
.
#
set.seed(123)
temp<- matrix( rnorm(12*8), ncol=12)
pos<- c(1:6,9:14)
bplot(temp)
#
par(las=1)
bplot( temp, pos=pos, names=paste( "Data",1:12, sep=""), horizontal=TRUE)
#
# Xmas boxplots in red and green
bplot( temp, pos=pos, col=c("red", "green"))
# add an axis on top
axis( 3)
Run the code above in your browser using DataLab