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, either as a |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
... |
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.