gg_value_between: Print value between samples

Description Usage Arguments Value

View source: R/ggValueBetween.R

Description

ggplot2 layer to display user specified text between two samples in a bargraph. Used in conjunction with gg_bracket_between().

Usage

1
2
3
gg_value_between(data, value, sample_col, sample1, sample2, mean_col,
  group_col = NA, group1 = NA, group2 = NA, dodge.width = 0.9,
  extra_y_space = 0, ...)

Arguments

data

The dataframe used in the plot

value

The text to be displayed

sample_col

Column name of the samples in data

sample1

The first sample to be compared

sample2

The second sample to be compared

mean_col

Column name of the means of the observations. Usually the y-axis of the bargraph.

group_col

Optional – Column name of the sample groups if applicable. Leave NA if there are no groups.

group1

Optional – The group to which the first sample belongs. Leave NA if there are no groups.

group2

Optional – The group to which the second sample belongs. Leave NA if there are no groups.

dodge.width

Optional – The width of position_dodge() in the ggplot if groups are present. Usually 0.9.

extra_y_space

Optional – Numeric to adjust position of the bracket up or down from its default location.

...

Additional optional parameters/asthetics. e.g. color for font color or size for font size.

Value

ggplot2 annotation layer


azzoam/ggBrackets documentation built on June 4, 2017, 12:09 a.m.