Description Usage Arguments Value Examples
Makes vertical boxplots
1 2 |
xcoord |
X coordinate for plotting boxplot |
y |
Vector of the 6 boxplot statistics (e.g. 5, 25, 50, 75, 95th percentile and mean) |
n |
Number of boxplots to be placed on plot |
inhgt |
Height of the interquartile box, scaled to size of device and number of boxes to be plotted |
whiskhgt |
Height of the 95th percentile whiskers, scaled in the same way as inhgt |
bcol |
A 1 or 4 element vector of colors for whiskers, interquartile box, median line, and mean point |
bfill |
Fill color for interquartile box |
pcex |
Size of point indicating the mean |
lwd |
A 1 or 3 element vector of widths for whiskers, interquartile box, and median line |
Boxplot
1 2 3 4 5 6 7 8 9 | x <- lapply(1:4, function(x) box_stats(sample(1:100, 10)))
plot(c(1, 100), c(0, 5), pch = "", xlab = "value", ylab = "", yaxt = "n")
#for(i in 1:length(x)) boxplot_h(x[[i]], ycoord = i, n = 4)
#for(i in 1:length(x)) boxplot_h(x[[i]], ycoord = i, n = 4, pch = 5, pcex = 2)
#for(i in 1:length(x)) boxplot_h(x[[i]], ycoord = i, n = 4, bcol = "red", bfill = "grey", whiskcol = "grey")
for(i in 1:length(x)) {
boxplot_h(x[[i]], ycoord = i, n = 4, bcol = c("black", "grey40", "red", "blue"), bfill = "grey80",
lwd = c(2, 1, 7), whiskcol = "grey")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.