简体   繁体   English

带有错误栏的ggplot条形图

[英]ggplot barplot with error bar

Hi I tried a code from one of you for drawing a barplot with error bar. 嗨,我尝试了一个人的代码来绘制带有错误栏的条形图。

But it didn't work, I am sure that the code provide should work (the figure produced is exactly what I wanted) 但这没有用,我确信提供的代码应该可以用(产生的数字正是我想要的)

Here is the code, did I miss something? 这是代码,我错过了什么吗?

> my.df <- read.table(text = "group N        val         sd         se         ci
 206 3 37.2269533  7.9688645  4.6008261 19.7957568
 207 3  2.0731505  2.2843009  1.3188417  5.6745180
 208 3  2.2965978  1.4120606  0.8152536  3.5077531
 209 3  3.1085132  1.1986664  0.6920504  2.9776525
 210 3  3.3735251  1.9226134  1.1100214  4.7760365
 211 3  4.0477951  2.9410503  1.6980162  7.3059739
 212 3  1.2391158  1.2345554  0.7127709  3.0668055
 213 2  1.3082374  1.1234220  0.7943793 10.0935460", header = TRUE)
> 
> ggplot(my.df, aes(x = factor(group), y = val)) +  
   geom_bar(position = position_dodge()) + 
   geom_errorbar(aes(ymin=val-se, ymax=val+se))

I had that message: 我收到该消息:

Error in rename(x, .base_to_ggplot, warn_missing = FALSE) : 
  could not find function "revalue"

revalue is a plyr function which has been introduced 5 months ago. revalue是5个月前引入的plyr函数。 Probably you are running an older version than that. 可能您正在运行的是旧版本。 Updating plyr and ggplot2 should fix that problem. 更新plyrggplot2应该可以解决该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM