qbeeswarm: Quick beeswarm-boxplots

Description Usage Arguments Value Examples

View source: R/qbeeswarm.R

Description

convenience function for making beeswarmplots with overlaid boxplots.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
qbeeswarm(
  df,
  x,
  y,
  xlab,
  ylab,
  box = TRUE,
  notch = TRUE,
  fill_box = "lightblue",
  alpha = 0.3,
  cex_axes = 18,
  grid = FALSE,
  colour,
  bw = FALSE,
  ...
)

Arguments

df

a data frame

x

A column name within df, the variable to be displayed on the x axis.

y

A column name within df, the variable to be displayed on the y axis.

xlab

(optional) add x axis label manually.

ylab

(optional) add y axis label manually.

box

Should the boxplot be displayed? Default is TRUE.

notch

Should the boxplot be displayed with a notch? Default is TRUE.

fill_box

fill colour (or value) of the boxplot.

alpha

alpha level of the boxplot color. Default is .3.

cex_axes

font size of tick labels and axis text. Default is 18. Set to FALSE to add manual controls.

grid

Should a grid be displayed? Default is FALSE.

colour

colour of the points in the beeswarm plot

bw

black-and-white: If set to TRUE, the plot will be printed in black and white. Does not work properly if colour is specified. Overrides fill_box.

...

further arguments to be passed on to ggplot.

Value

a ggplot2 beeswarm-and-boxplot.

Examples

1
2
3
4
set.seed(200)
df <- data.frame(A = c(rep("high", 50), rep("lo", 50)),
                B = round(runif(n = 100)*100))
qbeeswarm(df, x = A, y = B)

hartmast/wizard documentation built on Oct. 7, 2020, 4:16 p.m.