geom_boxplot: Box and whiskers plot.

Description Usage Arguments Details Examples

Description

The lower and upper "hinges" correspond to the first and third quartiles (the 25th and 75th percentiles). This differs slightly from the method used by the boxplot function, and may be apparent with small samples.

Usage

1
2
3
4
5
geom_boxplot(mapping = NULL, data = NULL, stat = "boxplot",
  position = "dodge", outlier.colour = NULL, outlier.shape = 19,
  outlier.size = 1.5, outlier.stroke = 0.5, notch = FALSE,
  notchwidth = 0.5, varwidth = FALSE, na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, ...)

Arguments

mapping

Set of aesthetic mapping created by aes or aes_.

data

The data to be displayed in this layer.

stat

Use to override the default connection between geom_boxplot and stat_boxplot

position

Position adjustment, either as a string, or the result of a call to a position adjustment function.

outlier.colour, outlier.shape, outlier.size, outlier.stroke

Default aesthetics for outliers.

notch

if FALSE(default) make a standard box plot.

notchwidth

for a notched box plot, width of the notch relative to the body (default 0.5)

varwidth

if FALSE(default) make a standard box plot.

na.rm

If FALSE, removes missing values with a warning (not used in ggplot2.SparkR).

show.legend

logical. Should this layer be included in the legends?

inherit.aes

If FALSE, overrides the default aesthetics, rather ehan combining with them.

...

other arguments passed on to layer.

Details

The upper whisker extends from the hinge to the highest value that is within 1.5 * IQR of the hinge, where IQR is the inter-quartile range, or distance between the first and third quartiles. The lower whisker extends from the hinge to the lowest value within 1.5 * IQR of the hinge. Data beyond the end of the whiskers are outliers and plotted as points (as specified by Tukey).

In a notched box plot, the notches extend 1.58 * IQR / sqrt(n). This gives a roughly 95 See McGill et al. (1978) for more details.

Examples

1
2
3
4
5
6
7
8
## Not run: 
ggplot(diamonds, aes(cut, price)) + geom_boxplot()

df <- createDataFrame(sqlContext, diamonds)
ggplot(df, aes(cut, price)) + geom_bar()
ggplot(df, aes(cut, price, fill = color)) + geom_boxplot()

## End(Not run)

SKKU-SKT/ggplot2.SparkR documentation built on May 9, 2019, 11:13 a.m.