Adding labels for mean values.
centrality_ggrepel( plot, data, x, y, type = "parametric", tr = 0.1, k = 2L, sample.size.label = TRUE, centrality.path = FALSE, centrality.path.args = list(color = "red", size = 1, alpha = 0.5), centrality.point.args = list(size = 5, color = "darkred"), centrality.label.args = list(size = 3, nudge_x = 0.4, segment.linetype = 4), ... )
plot | A |
---|---|
data | A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted. |
x | The grouping variable from the dataframe |
y | The response (a.k.a. outcome or dependent) variable from the
dataframe |
type | Type of statistic expected ( |
tr | Trim level for the mean when carrying out |
k | Number of digits after decimal point (should be an integer)
(Default: |
sample.size.label | Logical that decides whether sample size information
should be displayed for each level of the grouping variable |
centrality.path | Logical that decides whether individual data
points and means, respectively, should be connected using |
centrality.path.args | A list of additional aesthetic
arguments passed on to |
centrality.point.args | A list of additional aesthetic
arguments to be passed to |
centrality.label.args | A list of additional aesthetic
arguments to be passed to |
... | Additional arguments. |
# this internal function may not have much utility outside of the package set.seed(123) library(ggplot2) # make a plot p <- ggplot(data = iris, aes(x = Species, y = Sepal.Length)) + geom_boxplot() # add means ggstatsplot:::centrality_ggrepel( data = iris, plot = p, x = Species, y = Sepal.Length )