geom_errors | R Documentation |
errors
objectsAutomatic errorbars for variables with uncertainty.
geom_errors(mapping = NULL, data = NULL, stat = "identity",
position = "identity", ..., na.rm = FALSE, orientation = NA,
show.legend = NA, inherit.aes = TRUE)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Other arguments passed on to
|
na.rm |
If |
orientation |
The orientation of the layer. The default ( |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
geom_errors()
understands the following aesthetics
(required aesthetics are in bold):
x
or y
alpha
colour
group
linetype
linewidth
if (requireNamespace("ggplot2", quietly=TRUE)) {
iris.e <- iris
iris.e[1:4] <- lapply(iris.e[1:4], function(x) set_errors(x, x*0.02))
library(ggplot2)
ggplot(iris.e) + aes(Sepal.Length, Sepal.Width, color=Species) +
geom_point() + geom_errors()
ggplot(iris.e) + aes(Sepal.Length, Sepal.Width, color=Species) +
geom_point() + geom_errors(width=0.05, height=0.05, linewidth=0.2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.