Y axis won't change, error bars won't show

My y axis won't change on my graph and therefore the error bars won't show-

Code:
ggplot(data_sum, aes(x=group, y=weightchange)) +
geom_bar(stat = "identity", fill="skyblue")
geom_crossbar( aes(x=group, y=weightchange, ymin=weightchange-1.52, ymax=weightchange+1.52), width=0.4, colour="orange", alpha=0.9, size=1.3)
My graph:

You are missing a + between your geom_bar and your geom_crossbar.

library(ggplot2)
data_sum <- data.frame(group = c("control", "food.inhibition"), 
                 weightchange = c(-0.08, -0.4))

ggplot(data_sum, aes(x=group, y=weightchange)) +
  geom_bar(stat = "identity", fill="skyblue") +
geom_crossbar( aes(x=group, y=weightchange, ymin=weightchange-1.52, 
                   ymax=weightchange+1.52), width=0.4, colour="orange", 
               alpha=0.9, size=1.3)

Created on 2020-04-02 by the reprex package (v0.3.0)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.