Description Usage Arguments Details Value Author(s) References Examples
Add a box plot in the margin of a scatterplot
1 | addBoxplot(x, gap = 0.01, side, outpch = 20)
|
x |
a numeric vector, the data to display in the boxplot |
gap |
distance above or right of the edge of the plot, as a proportion of the width of the plot; negative values will position the boxplot below or left of the edge. |
side |
1=bottom, 2=left, 3=top, 4=right |
outpch |
plotting symbol to use for outliers; choose one which won't be confused with the points in the scatterplot. |
Box plots of each variable along the appropriate side are a nice idea (cf Quinn & Keough) but take up lots of space and require multiplot layout. As Tufte points out, the box isn't necessary, so this fits a box-ish plot into the frame of the scatter plot.
Nothing; used for its plotting side-effect.
Mike Meredith, 29 April 2012
Quinn, G P; M J Keough 2002. Experimental design and data analysis for biologists. Cambridge University Press, Cambridge UK.
1 2 3 4 | data(trees)
plot(Volume ~ Girth, data=trees, bty='l')
addBoxplot(trees$Volume, side=4)
addBoxplot(trees$Girth, side=3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.