boxplot_v: Makes vertical boxplots

Description Usage Arguments Value Examples

Description

Makes vertical boxplots

Usage

1
2
boxplot_v(xcoord, y, n, inhgt = 20, whiskhgt = 5, bcol = "black",
  bfill = "grey", pcex = 1, lwd = 1, pch = 20)

Arguments

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

Value

Boxplot

Examples

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")
}

PrincetonUniversity/lmisc documentation built on May 8, 2019, 3:23 a.m.