- data
a data frame containing statitistical test results. The expected
default format should contain the following columns: group1 | group2 |
p | y.position | etc
. group1
and group2
are the groups that
have been compared. p
is the resulting p-value. y.position
is
the y coordinates of the p-values in the plot.
- label
the column containing the label (e.g.: label = "p" or label =
"p.adj"), where p
is the p-value. Can be also an expression that can
be formatted by the glue()
package. For example, when
specifying label = "t-test, p = {p}", the expression {p} will be
replaced by its value.
- y.position
column containing the coordinates (in data units) to be used
for absolute positioning of the label. Default value is "y.position". Can be
also a numeric vector.
- xmin
column containing the position of the left sides of the brackets.
Default value is "group1".
- xmax
(optional) column containing the position of the right sides of
the brackets. Default value is "group2". If NULL, the p-values are plotted
as a simple text.
- x
x position of the p-value. Should be used only when you want plot the
p-value as text (without brackets).
- size, label.size
size of label text.
- bracket.size
Width of the lines of the bracket.
- bracket.nudge.y
Vertical adjustment to nudge brackets by. Useful to
move up or move down the bracket. If positive value, brackets will be moved
up; if negative value, brackets are moved down.
- bracket.shorten
a small numeric value in [0-1] for shortening the with
of bracket.
- color
text and line color. Can be variable name in the data for coloring by groups.
- linetype
linetype. Can be variable name in the data for changing linetype by groups.
- tip.length
numeric vector with the fraction of total height that the
bar goes down to indicate the precise column. Default is 0.03.
- remove.bracket
logical, if TRUE
, brackets are removed from the
plot. Considered only in the situation, where comparisons are performed
against reference group or against "all".
- step.increase
numeric vector with the increase in fraction of total
height for every additional comparison to minimize overlap.
- step.group.by
a variable name for grouping brackets before adding
step.increase. Useful to group bracket by facet panel.
- hide.ns
can be logical value or a character vector.
Case when logical value. If TRUE, hide ns symbol when displaying
significance levels. Filter is done by checking the column
p.adj.signif
, p.signif
, p.adj
and p
.
Case when character value. Possible values are "p" or "p.adj", for filtering out non significant.
- vjust
move the text up or down relative to the bracket. Can be also a
column name available in the data.
- coord.flip
logical. If TRUE
, flip x and y coordinates so that
horizontal becomes vertical, and vertical, horizontal. When adding the
p-values to a horizontal ggplot (generated using
coord_flip()
), you need to specify the option
coord.flip = TRUE
.
- position
position adjustment, either as a string, or the result of a
call to a position adjustment function.
- ...
other arguments passed to the function geom_bracket()
or
geom_text()