# Boxplot(s)

Example Data | 244 | 238 | 1 |

Help | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

## Box Plots## DescriptionProduce box-and-whisker plot(s) of the given (grouped) values. ## Usageboxplot(x, ...) ## S3 method for class 'formula' boxplot(formula, data = NULL, ..., subset, na.action = NULL, drop = FALSE, sep = ".", lex.order = FALSE) ## Default S3 method: boxplot(x, ..., range = 1.5, width = NULL, varwidth = FALSE, notch = FALSE, outline = TRUE, names, plot = TRUE, border = par("fg"), col = NULL, log = "", pars = list(boxwex = 0.8, staplewex = 0.5, outwex = 0.5), horizontal = FALSE, add = FALSE, at = NULL) ## Arguments
## DetailsThe generic function If multiple groups are supplied either as multiple arguments or via a
formula, parallel boxplots will be plotted, in the order of the
arguments or the order of the levels of the factor (see
Missing values are ignored when forming boxplots. ## ValueList with the following components:
## ReferencesBecker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
Chambers, J. M., Cleveland, W. S., Kleiner, B. and Tukey, P. A. (1983)
Murrell, P. (2005) See also ## Examples## boxplot on a formula: boxplot(count ~ spray, data = InsectSprays, col = "lightgray") # *add* notches (somewhat funny here): boxplot(count ~ spray, data = InsectSprays, notch = TRUE, add = TRUE, col = "blue") boxplot(decrease ~ treatment, data = OrchardSprays, log = "y", col = "bisque") rb <- boxplot(decrease ~ treatment, data = OrchardSprays, col = "bisque") title("Comparing boxplot()s and non-robust mean +/- SD") mn.t <- tapply(OrchardSprays$decrease, OrchardSprays$treatment, mean) sd.t <- tapply(OrchardSprays$decrease, OrchardSprays$treatment, sd) xi <- 0.3 + seq(rb$n) points(xi, mn.t, col = "orange", pch = 18) arrows(xi, mn.t - sd.t, xi, mn.t + sd.t, code = 3, col = "pink", angle = 75, length = .1) ## boxplot on a matrix: mat <- cbind(Uni05 = (1:100)/21, Norm = rnorm(100), `5T` = rt(100, df = 5), Gam2 = rgamma(100, shape = 2)) boxplot(mat) # directly, calling boxplot.matrix() ## boxplot on a data frame: df. <- as.data.frame(mat) par(las = 1) # all axis labels horizontal boxplot(df., main = "boxplot(*, horizontal = TRUE)", horizontal = TRUE) ## Using 'at = ' and adding boxplots -- example idea by Roger Bivand : boxplot(len ~ dose, data = ToothGrowth, boxwex = 0.25, at = 1:3 - 0.2, subset = supp == "VC", col = "yellow", main = "Guinea Pigs' Tooth Growth", xlab = "Vitamin C dose mg", ylab = "tooth length", xlim = c(0.5, 3.5), ylim = c(0, 35), yaxs = "i") boxplot(len ~ dose, data = ToothGrowth, add = TRUE, boxwex = 0.25, at = 1:3 + 0.2, subset = supp == "OJ", col = "orange") legend(2, 9, c("Ascorbic acid", "Orange juice"), fill = c("yellow", "orange")) ## With less effort (slightly different) using factor *interaction*: boxplot(len ~ dose:supp, data = ToothGrowth, boxwex = 0.5, col = c("orange", "yellow"), main = "Guinea Pigs' Tooth Growth", xlab = "Vitamin C dose mg", ylab = "tooth length", sep = ":", lex.order = TRUE, ylim = c(0, 35), yaxs = "i") ## more examples in help(bxp) |

R Output | Dataset Referenced | Date |
---|---|---|

Boxplot(s) | Example Data | May 30, 2017 |

Boxplot(s) | Example Data | May 30, 2017 |

Boxplot(s) | Example Data | May 30, 2017 |

Boxplot(s) | Example Data | May 30, 2017 |

Boxplot(s) | Example Data | May 30, 2017 |

Recent Queries | App/Dataset | By | Date |
---|---|---|---|

Picostat Output - Simple Linear Regression | R Dataset / Package datasets / esoph | hyi2 | October 29, 2020 - 5:44 AM |

Picostat Output - Visual Summaries | R Dataset / Package datasets / esoph | hyi2 | October 29, 2020 - 5:42 AM |

Picostat Output - Simple Linear Regression | R Dataset / Package datasets / esoph | hyi2 | October 29, 2020 - 5:42 AM |

Picostat Output - Numerical Summaries | R Dataset / Package datasets / quakes | wicetram | October 24, 2020 - 3:20 PM |

Picostat Output - Visual Summaries | R Dataset / Package datasets / quakes | wicetram | October 24, 2020 - 3:17 PM |

#### Pagination

Title | Authored on | Content type |
---|---|---|

R Dataset / Package Stat2Data / TwinsLungs | March 9, 2018 - 1:06 PM | Dataset |

R Dataset / Package mediation / student | March 9, 2018 - 1:06 PM | Dataset |

R Dataset / Package robustbase / lactic | March 9, 2018 - 1:06 PM | Dataset |

OpenIntro Statistics Dataset - resume | August 9, 2020 - 2:38 PM | Dataset |

R Dataset / Package vcd / CoalMiners | March 9, 2018 - 1:06 PM | Dataset |