我的代码现在看起来像这样:
library(ggplot2)
ggplot (y=mean, data=a)+geom_bar(stat="identity")+geom_errorbar(aes(ymin=mean - sd, ymax=mean + sd,width=0.15))
我收到以下错误:
mean-sd中的错误:二元运算符的非数字参数
这些是我加载的库:
if(!require(psych)){install.packages("psych")}
if(!require(FSA)){install.packages("FSA")}
if(!require(Rmisc)){install.packages("Rmisc")}
if(!require(ggplot2)){install.packages("ggplot2")}
if(!require(car)){install.packages("car")}
if(!require(multcompView)){install.packages("multcompView")}
if(!require(lsmeans)){install.packages("lsmeans")}
if(!require(rcompanion)){install.packages("rcompanion")}
编辑:
structure(list(morning.time = c(39.28, 42.32, 45.56, 43.47, 45.1,
42.44, 49.2, 45.99, 52.48, 49.16, 49.63, 47.4, 48.14, 47.89,
52.91, 51.56, 49.28, 53.62), morning.pushups = c(32L, 34L, 37L,
38L, 42L, 45L, 51L, 51L, 52L, 54L, 53L, 52L, 53L, 54L, 57L, 56L,
54L, 59L), evening.time = c(37.75, 39.58, 42.88, 38.45, 40.72,
37.12, 39.89, 45.31, 39.73, 42.69, 42.47, 45.47, 43.65, 47.78,
46.97, 47.75, 46.72, 42.12), evening.pushups = c(30L, 32L, 38L,
34L, 39L, 37L, 35L, 42L, 39L, 47L, 48L, 48L, 48L, 54L, 52L, 47L,
49L, 47L)), .Names = c("morning.time", "morning.pushups", "evening.time",
"evening.pushups"), class = "data.frame", row.names = c(NA, -18L
))