boxwork | R Documentation |
Make boxplots
boxwork(
df,
x,
y,
xs = defcx(),
ys = defy(),
fill = opts$boxplot.fill,
alpha = opts$boxplot.alpha,
hline = NULL,
title = NULL,
shown = TRUE,
points = NULL,
outlier.shape = opts$boxplot.outlier.shape,
...
)
df |
data frame to plot |
x |
character name for x-axis data |
y |
character name for y-axis data |
xs |
see |
ys |
see |
fill |
passed to |
alpha |
passed to |
hline |
used to draw horizontal reference line |
title |
passed to |
shown |
if |
points |
show points in back of transparent boxes; if |
outlier.shape |
passed to |
... |
arguments passed to |
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.