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)
Question
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 ?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow