- data
a data.frame containing the variables in the formula.
- formula
a formula of the form x ~ group
where x
is a
numeric variable giving the data values and group
is a factor with
one or multiple levels giving the corresponding groups. For example,
formula = TP53 ~ cancer_group
.
- fun
summary statistics functions used to compute automatically suitable
y positions of p-value labels and brackets. Possible values include:
"max", "mean", "mean_sd", "mean_se", "mean_ci", "median",
"median_iqr", "median_mad"
.
For example, if fun = "max"
, the y positions are guessed as follow:
1. Compute the maximum of each group (groups.maximum)
2. Use the highest groups maximum as the first bracket y position
3.
Add successively a step increase for remaining bracket y positions.
When the main plot is a boxplot, you need the option fun = "max"
, to
have the p-value bracket displayed at the maximum point of the group.
In some situations the main plot is a line plot or a barplot showing the
mean+/-error bars
of the groups, where error can be SE (standard
error), SD (standard deviation) or CI (confidence interval). In this case,
to correctly compute the bracket y position you need the option fun =
"mean_se"
, etc.
- ref.group
a character string specifying the reference group. If
specified, for a given grouping variable, each of the group levels will be
compared to the reference group (i.e. control group).
- comparisons
A list of length-2 vectors specifying the groups of
interest to be compared. For example to compare groups "A" vs "B" and "B" vs
"C", the argument is as follow: comparisons = list(c("A", "B"), c("B",
"C"))
- step.increase
numeric vector with the increase in fraction of total
height for every additional comparison to minimize overlap.
- y.trans
a function for transforming y axis scale. Value can be
log2
, log10
and sqrt
. Can be also any custom function
that can take a numeric vector as input and returns a numeric vector,
example: y.trans = function(x){log2(x+1)}
- stack
logical. If TRUE, computes y position for a stacked plot. Useful
when dealing with stacked bar plots.
- scales
Should scales be fixed ("fixed"
, the default), free
("free"
), or free in one dimension ("free_y"
)?. This option is
considered only when determining the y position. If the specified value is
"free"
or "free_y"
, then the step increase of y positions will
be calculated by plot panels. Note that, using "free"
or
"free_y"
gives the same result. A global step increase is computed
when scales = "fixed"
.
- test
an object of class rstatix_test
as returned by
t_test()
, wilcox_test()
,
sign_test()
, tukey_hsd()
,
dunn_test()
.
- x
variable on x axis.
- group
group variable (legend variable).
- dodge
dodge width for grouped ggplot/test. Default is 0.8. Used only
when x
specified.
- ...
other arguments to be passed to the function
t.test
.