Make boxplots
data frame to plot
character name for x-axis data
character name for y-axis data
see defcx
see defy
passed to geom_boxplot
passed to geom_boxplot
used to draw horizontal reference line
passed to ggtitle
if TRUE
provide a numeric summary of each
box (see details)
show points in back of transparent boxes; if TRUE
,
a default display of points is made on top of boxes; also may be passed as
a list of arguments to pass to geom_point
; see details
passed to geom_boxplot
arguments passed to geom_boxplot
Since this function creates a boxplot,
the x
column must be character, factor
or logical and y
column must
be numeric.
If shown
is TRUE
, a numeric summary of each
box is included
below each box. In the summary, n
is the number of
non-NA observations in the y
column for that box and
N
is the number of unique ID
values for
that box. An error will be generated if ID
does
not exist in the plotting data frame when shown
is
TRUE
. When N
is equal to n
in the
summary, only n
is shown.
The summaries will not be correct if the plot is eventually faceted by
another variable in the data set. In this case, either use
shown=FALSE
or create the plot with split_plot
.
When the user passes the points
argument, outlier.shape
is
automatically switched to NA
so that outlier points are only plotted
once. The fill
argument is also set to NA
, so that boxes become
transparent, showing the points.
When the user sets points
to TRUE
, grey points are shown
in back of transparent boxes and the points are jittered in the x-direction.
The user can customize the display of the points by passing a list of
arguments for geom_point
(for example, change the color, transparency,
size, jitter amount, etc). The user can also pass jitter_width
in
the points
list to set the amount of jitter in the x-direction while
keeping jitter in the y-direction zero. Passing jitter_width
will
override any other value passed under position
in the points
list.