我正在尝试在条形图中添加错误条,但是我一直收到错误消息。初次使用ggplot2的用户,感谢您的帮助或解释!
我使用了len,mean-sd,se特定值..但到目前为止,对我来说没有任何作用。
我使用了以下代码:
ggplot(data = means, aes(x = hear, y = Mean)) +
geom_bar(stat = "identity") +
geom_errorbar(aes(ymin = value - Error, ymax = value + Error,
fill = variable))
ggplot(data = means, aes(x = hear, y = Mean)) +
geom_bar(stat = "identity") +
geom_errorbar(aes(ymin = len - sd, ymax = len + sd),
width = .2, position = position_dodge(.9))
ggplot(data = means, aes(x = hear, y = Mean)) +
geom_bar(stat = "identity") +
geom_errorbar(aes(ymin = means - sd, ymax = means + sd),
width = .2, position = position_dodge(.9))
我使用了这段代码,但是它把错误条放在我的条的底部而不是顶部:
ggplot(data = means, aes(x = hear, y = Mean)) +
geom_bar(stat = "identity") +
geom_errorbar(aes(ymin = se, ymax = se),
width = .2, position = position_dodge(.9))
我不断收到错误代码,例如:找不到对象以及二进制运算符的非数字参数。