Produce box-and-whisker plot(s) ordered by function such as mean or median.
Produce box-and-whisker plot(s) ordered by function such as
mean or median. Wrapper around boxplot.
sortBoxplot( formula, data = NULL, decreasing = TRUE, FUN = "median", idx = NULL, col = "gray", ... )
formula |
a formula, such as 'y ~ Condition', where 'y' is a numeric vector of data values to be split into groups according to the grouping variable 'Condition' (usually a factor). |
data |
a data.frame from which the variables in 'formula' should be taken. |
decreasing |
Logical: Indicating whether the sort should be increasing or decreasing. |
FUN |
a function to compute the summary statistics which can be applied to all data subsets. |
idx |
Numeric vector providing the ordering of groups instead of
specifying a function in |
col |
Fill color of the boxplots. Alias for |
... |
Other parameters to adjust the layout of the boxplots.
See |
The ordered stats.
Jacolien van Rij
Other Functions for plotting:
addInterval(),
add_bars(),
add_n_points(),
alphaPalette(),
alpha(),
check_normaldist(),
color_contour(),
dotplot_error(),
drawDevArrows(),
emptyPlot(),
errorBars(),
fill_area(),
getCoords(),
getFigCoords(),
getProps(),
gradientLegend(),
legend_margin(),
marginDensityPlot(),
plot_error(),
plot_image(),
plotsurface()
head(ToothGrowth) # sort on basis of mean length: sortBoxplot(len ~ dose:supp, data = ToothGrowth) # sort on basis of median length: sortBoxplot(len ~ dose:supp, data = ToothGrowth, decreasing=FALSE) # on the basis of variation (sd): sortBoxplot(len ~ dose:supp, data = ToothGrowth, FUN='sd', col=alpha(2))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.