If my data.frame is as shown in Picture.
Values represent means ± SE. How can I make a barplot with errorbars?
If my data.frame is as shown in Picture.
Values represent means ± SE. How can I make a barplot with errorbars?
Easy way would be to use the ggplot2 -package. Sample code below:
library(ggplot2)
data <- data.frame(
name=letters[1:5],
value=sample(seq(4,15),5),
se=c(1,0.2,3,2,4))
ggplot(data) +
geom_bar( aes(x=name, y=value), stat="identity") +
geom_errorbar( aes(x=name, ymin=value-se, ymax=value+se), width=0.4,
colour="orange")