Usage
tbplot(x, by, log = FALSE, logx = FALSE, notch = TRUE, xlab = "",
ylab = deparse(substitute(x)), ylim = NULL, main = "",
label = NULL, plot.order = NULL, xpos = NA, width, space = 0.25,
las = 1, cex = 1, adj = 0.5, add = FALSE, ssll = 1, colr = 8,
...)
Arguments
x
name of the variable to be plotted.
by
the name of the factor variable to be used to subdivide the data. See Details below for when by
is undefined.
log
if it is required to display the data with logarithmic (y-axis) scaling, set log = TRUE
.
logx
if the position of the Tukey boxplot fences are to be computed on the basis of log transformed data set logx = TRUE
. For general usage, if log = TRUE
then set logx = TRUE
.
notch
determines if the boxplots are to be notched such that the notches indicate the 95% confidence intervals for the medians. The default is to notch the boxplets, to suppress the notches set notch = FALSE
. See Details below.
xlab
a title for the x-axis, by default none is provided.
ylab
a title for the y-axis. It is often desirable to replace the default y-axis title of the input variable name text string with a more informative title, e.g., ylab = "Cu (mg/kg) in <2 mm="" c-horizon="" soil"<="" code="">.2>
ylim
defines the limits of the y-axis if the default limits based on the range of the data are unsatisfactory. It can be used to ensure the y-axis scaling in multiple sets of boxplots are the same to facilitate visual comparison.
main
a main title may be added optionally above the display by setting main
, e.g., main = "Kola Project, 1995"
.
label
provides an alternate set of labels for the boxplots along the x-axis. By default the character strings defining the factors are used. Thus, label = c("Alt1", "Alt2", "Alt3")
.
plot.order
provides an alternate order for the boxplots. Thus, plot.order = c(2, 1, 3)
will plot the 2nd ordered factor in the 1st position, the 1st in the 2nd, and the 3rd in its 3rd ordered postion, see Details and Examples below.
xpos
the locations along the x-axis for the individual vertical boxplots to be plotted. By default this is set to NA
, which causes default equally spaced positions to be used, i.e. boxplot 1 plots at value 1 on the x-axis, boxplot 2 at value 2, e
width
the width of the boxes, by default this is set to the minimum distance between all adjacent boxplots times the value of space
. With the default values of xpos
this results in a minimum difference of 1
, and with the
space
the space between the individual boxplots, by default this is 0.25 x-axis units.
las
controls whether the x-axis labels are written parallel to the x-axis, the default las = 1
, or are written down from the x-axis by setting las = 2
. See also, Details below.
cex
controls the size of the font used for the factor labels plotted along the x-axis. By default this is 1
, however, if the labels are long it is sometimes necessary to use a smaller font, for example cex = 0.8
results in a font 80
adj
controls the justification of the x-axis labels. By default they are centred, adj = 0.5
, to left justify them if the labels are written downwards at an angle set adj = 0
.
add
permits the user to plot additional boxplots into an existing display. It is recommended that this option is left as add = FALSE
.
ssll
determines the minimum data subset size for which a subset will be plotted. By default this is set to 1
, which leads to only a circle with a median bar being plotted, as the subset size increases additional features of the boxplot are displa
colr
by default the boxes are infilled in grey, colr = 8
. If no infill is required, set colr = 0
. See display.lty
for the range of available colours. ...
further arguments to be passed to methods.