Usage
stat_test_text(mapping = NULL, data = NULL,
geom = ifelse(text.box, "label", "text"), position = "identity",
na.rm = FALSE, show.legend = NA, inherit.aes = TRUE,
y.pos = NULL, y.expand.factor = 0.35, test = "parametric",
paired = FALSE, test.arg.list = list(), two.lines = TRUE,
p.value.digits = 3, p.value.digit.type = "round",
location.digits = 1, location.digit.type = "round",
nsmall = ifelse(location.digit.type == "round", location.digits, 0),
text.box = FALSE, alpha = 1, angle = 0, color = "black",
family = "", fontface = "plain", hjust = 0.5,
label.padding = ggplot2::unit(0.25, "lines"),
label.r = ggplot2::unit(0.15, "lines"), label.size = 0.25,
lineheight = 1.2, size = 4, vjust = 0.5, ...)
Arguments
mapping, data, position, na.rm, show.legend, inherit.aes
geom
Character string indicating which geom
to use to display the text.
Setting geom="text"
will use geom_text
to display the text, and
setting geom="label"
will use geom_label
to display the text.
The default value is geom="text"
unless the user sets text.box=TRUE
.
y.pos
Numeric scalar indicating the \(y\)-position of the text (i.e., the value of the
argument y
that will be used in the call to geom_text
or
geom_label
). The default value is y.pos=NULL
, in which
case y.pos
is set to the maximum value of all \(y\)-values plus
a proportion of the range of all \(y\)-values, where the proportion is
determined by the argument y.expand.factor
(see below).
y.expand.factor
For the case when y.pos=NULL
, a numeric scalar indicating the proportion
by which the range of all \(y\)-values should be multiplied by before adding
this value to the maximum value of all \(y\)-values in order to compute the
value of the argument y.pos
(see above).
The default value is y.expand.factor=0.35
.
test
A character string indicating whether to use a standard parametric test
(test="parametric"
, the default) or nonparametric test
(test="nonparametric"
) to compare groups.
paired
For the case of two groups, a logical scalar indicating whether the data
should be considered to be paired. The default value is paired=FALSE
.
NOTE: if the argument test.arg.list
is supplied and it includes a
component named paired
, the value of that component
is overriden by the value of the argument paired
.
test.arg.list
An optional list of arguments to pass to the function used to test for
group differences in location. The default value is an empty list:
test.arg.list=list()
. In particular, when there are two groups,
ci.and.test="parametric"
, and ci.arg.list
does not contain
a component specifying the value for var.equal
, this argument is
updated to include the component var.equal=TRUE
, which is not
the default behavior of t.test
.
NOTE: If test.arg.list
contains a component named "paired"
,
the value of that component is set to the value of the argument paired
(see above).
two.lines
For the case of one or two groups, a logical scalar indicating whether the
associated confidence interval should be be displayed on a second line
instead of on the same line as the p-value. The default is two.lines=TRUE
.
p.value.digits
An integer indicating the number of digits to use for displaying the
p-value. When p.value.digit.type="round"
(see below)
the argument p.value.digits
indicates the number of digits to round to,
and when p.value.digit.type="signif"
the argument p.value.digits
indicates the number of significant digits to display.
The default value is p.value.digits=3
.
p.value.digit.type
A character string indicating whether the p.value.digits
argument (see above)
refers to significant digits (p.value.digit.type="signif"
), or how many decimal
places to round to (p.value.digit.type="round"
, the default).
location.digits
For the case of one or two groups, an integer indicating the number of digits
to use for displaying the associated confidence interval.
When location.digit.type="round"
(see below)
the argument location.digits
indicates the number of digits to round to,
and when location.digit.type="signif"
the argument location.digits
indicates the number of significant digits to display.
The default value is location.digits=1
.
location.digit.type
For the case of one or two groups, a character string indicating
whether the location.digits
argument (see above)
refers to significant digits
(location.digit.type="signif"
), or how many decimal
places to round to (location.digit.type="round"
; the default).
nsmall
For the case of one or two groups, an integer passed to the function
format
indicating the the minimum number of digits to use
to the right of the decimal point for the associated confidence interval.
The default value is nsmall=digits
when digit.type="round"
and
nsmall=0
when digit.type="signif"
. When nsmall
is greater than 0,
the two confidence limits will have the same number of digits to the
right of the decimal point (including, possibly, trailing zeros).
To omit trailing zeros, set nsmall=0
.
text.box
Logical scalar indicating whether to surround the text with a text box (i.e.,
whether to use geom_label
instead of
geom_text
). This argument can be overridden by simply
specifying the argument geom
.
alpha, angle, color, family, fontface, hjust, vjust, lineheight, size
label.padding, label.r, label.size
…
Other arguments passed on to layer
.