geom_crossbar_predefined | R Documentation |
Adds a crossbar to a ggplot. Best used when comparing one categorical and one numeric variable using geom_point / geom_jitter(height=0).
geom_crossbar_predefined( summaryfunction = stats::median, width = 0.4, size = 0.3, colour )
summaryfunction |
a function run on the y aesthetic to determine where line is drawn. Options include median, mean, max, min, or any other function that summarises a numeric vector into a single number (function) |
width |
width of crossbar |
size, colour |
ggplot aesthetics |
ggplot geom
mtcars %>% ggplot2::ggplot(ggplot2::aes(cyl>6, mpg)) + ggplot2::geom_point() + geom_crossbar_predefined()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.