# NOT RUN {
# creating a basic plot
set.seed(123)
library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg)) +
geom_point()
# adding a label
ggstatsplot:::line_labeller(
plot = p,
x = median(mtcars$wt),
y = mean(mtcars$mpg),
k = 2,
label.args = list(color = "red"),
label.text = "median"
)
# }
Run the code above in your browser using DataLab