0

Is there a function in R that does the following thing:

Taken c(10,11,20,22,30,31) and c(1,1,2,2,3,3)

plot the mean of 10 and 11 in position 1 on the x axis, the mean of 20 and 22 in position 2 on the x-axis and the mean of 30 and 31 in position 3 in the x-axis and also add the apropriate error bars for standard deviation around the points ?

If not, how to do such a thing ?

bmu
  • 35,119
  • 13
  • 91
  • 108
Remi.b
  • 17,389
  • 28
  • 87
  • 168

1 Answers1

0
dat <- data.frame(y=c(10,11,20,22,30,31),
                  x=c(1,1,2,2,3,3))

library("ggplot2")
ggplot(dat,aes(x,y))+stat_summary(fun.data=mean_cl_normal)
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453