0

enter image description hereIf my data.frame is as shown in Picture.

Values represent means ± SE. How can I make a barplot with errorbars?

M.R.Wani
  • 107
  • 1
  • 11
  • Could you make your problem reproducible by sharing a sample of your data so others can help (please do not use `str()`, `head()` or screenshot)? You can use the [`reprex`](https://reprex.tidyverse.org/articles/articles/magic-reprex.html) and [`datapasta`](https://cran.r-project.org/web/packages/datapasta/vignettes/how-to-datapasta.html) packages to assist you with that. See also [Help me Help you](https://speakerdeck.com/jennybc/reprex-help-me-help-you?slide=5) & [How to make a great R reproducible example?](https://stackoverflow.com/q/5963269) – Tung Nov 26 '18 at 06:54

1 Answers1

0

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")
Aaro Viertiö
  • 219
  • 1
  • 5