Description Usage Arguments Examples
* 'geom_stat_crossbar()' - Tailored variant of 'ggplot2::geom_crossbar()' * 'geom_stat_text()' - Tailored variant of 'ggplot2::geom_text()' * 'geom_stat_label()' - Tailored variant of 'ggplot2::geom_label()'
'geom_stat_label' and 'geom_stat_text' automatically float value on the top edge of the plot. 'geom_stat_label' is set to 'alpha = .5' by default. 'geom_stat_crossbar' is set to 'width = .5' by default.
These will inherit 'mapping' from the intial 'ggplot(..., mapping = )' layer, so aesthetic mappings can be specified there, e.g. color by donor.
1 2 3 4 5 | geom_stat_crossbar(data, width = 0.5, ...)
geom_stat_text(data, label = label, ...)
geom_stat_label(data, label = label, ...)
|
data |
'data.frame', the result from 'make_stats()' |
width |
'double' |
... |
arguments passed on to underlying geom. Can not be related to 'mapping'. Can be arguments like 'size', 'position', and 'color'. |
label |
'name', bare column name to be used in 'aes(label = )' |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(ggplot2)
data(mtcars)
mtcars$cyl <- as.factor(mtcars$cyl)
m <- lm(log10(mpg) ~ 0 + cyl, data = mtcars)
stats <- make_stats(m)
p <- ggplot(mtcars, aes(cyl, mpg)) +
geom_point() +
geom_stat_crossbar(stats)
p
p + geom_stat_text(stats)
p + geom_stat_label(stats)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.