geom_stat_crossbar: ggplot geoms to make it easy to plot the results of...

Description Usage Arguments Examples

View source: R/model_geoms.R

Description

* '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.

Usage

1
2
3
4
5
geom_stat_crossbar(data, width = 0.5, ...)

geom_stat_text(data, label = label, ...)

geom_stat_label(data, label = label, ...)

Arguments

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 = )'

Examples

 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)

hemoshear/assayr2 documentation built on Nov. 8, 2019, 6:13 p.m.