general.box_plot_facetted: Function to create boxplots of a metric variable, grouped by...

Description Usage Arguments Value Author(s) Examples

Description

Function to create boxplots of a metric variable, grouped by two nominal variables

Usage

1
2
3
general.box_plot_facetted(data, group_by1, group_by2, col.jitter_by = NULL,
  shape_jitter_by = NULL, title = NULL, xlab = NULL, ylab = NULL,
  legend = FALSE, rotate = FALSE)

Arguments

data

A data frame with group variables and a column with numeric values. (Required)

group_by1

First grouping variable for which the plot will be facetted by. (Required)

group_by2

Second grouping variable which defines the subgroup of group1 (Required)

col.jitter_by

The variable name by which the jitter points will be colored by. (Default: NULL)

shape_jitter_by

The variable name by which the jitter points will be shaped by. (Default: NULL)

title

The title of the plot (Default: NULL)

xlab

The x-axis label (Default: NULL)

ylab

The y-axis label (Default: NULL)

legend

Flag indicating whether the legend should be displayed (Default: FALSE)

rotate

Flag indicating whether the x-axis labels should be rotated by 45° (Default: FALSE)

Value

A ggplot figure

Author(s)

Jens Hooge

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
require(reshape2)
n <- 500
df <- data.frame(A=sample(c("a1", "a2", "a3"), n, replace=TRUE),
                 B=sample(c("b1", "b2"), n, replace=TRUE),
                 C=sample(c("c1", "c2", "c3"), n, replace=TRUE),
                 D=sample(c("d1", "d2", "d3"), n, replace=TRUE),
                 value=rnorm(n, 100, 1))
                 
general.box_plot_facetted(df, group_by1 = "A", group_by2 = "B",
                  col.jitter_by = "A", shape_jitter_by = "C", 
                  rotate=TRUE)

## End(Not run)

jhooge/BioViz documentation built on May 19, 2019, 9:28 a.m.