x
-axis variable.R/helpers_gghistostats_graphics.R
histo_labeller.Rd
Helper function for adding centrality parameter value and/or a
test value for the continuous, numeric x
-axis variable.
histo_labeller( plot, x, y.label.position, test.value = 0, test.k = 0, test.value.line = FALSE, test.value.line.args = list(size = 1), test.value.label.args = list(), centrality.parameter = "mean", centrality.k = 2, centrality.line.args = list(color = "blue", size = 1), centrality.label.args = list(color = "blue"), ... )
plot | A |
---|---|
x | A numeric variable from the dataframe |
test.value | A number specifying the value of the null hypothesis
(Default: |
test.k | Integer denoting the number of decimal places expected for
|
test.value.line | Logical that decides whether a line corresponding to
the |
test.value.line.args | A list of additional aesthetic arguments to be
passed to the |
centrality.parameter | Decides which measure of central tendency
( |
centrality.k | Integer denoting the number of decimal places expected
for centrality parameter label. (Default: |
centrality.line.args, test.value.line.args | A list of additional
aesthetic arguments to be passed to the |
centrality.label.args, test.value.label.args | A list of additional
aesthetic arguments to be passed to the |
... | Currently ignored. |
# \donttest{ library(ggplot2) # creating a plot; lines and labels will be superposed on this plot p <- ggplot(mtcars, aes(wt, mpg)) + geom_point() # computing `y`-axis positions for line labels y_label_pos <- median( x = ggplot2::layer_scales(p)$y$range$range, na.rm = TRUE ) # adding labels ggstatsplot:::histo_labeller( plot = p, x = mtcars$wt, y.label.position = y_label_pos, test.value.line = TRUE )# }